Mutex Cache Karazy?

Having a very wierd and bizarre error with the site ..

Above the header ::

Warning: fopen(/home/dg/public_html/wp-content/cache/wp_cache_mutex.lock) [function.fopen]: failed to open stream: Permission denied in /home/dg/public_html/wp-content/plugins/wp-cache/wp-cache-phase2.php on line 79

In the footer ::

Warning: flock(): supplied argument is not a valid stream resource in /home/dg/public_html/wp-content/plugins/wp-cache/wp-cache-phase2.php on line 88

Warning: flock(): supplied argument is not a valid stream resource in /home/dg/public_html/wp-content/plugins/wp-cache/wp-cache-phase2.php on line 97

Hrrmmm.

Not sure about this. Maybe it’s a little blue gremlin running about inside the engine room, namely, my hosting providers.

Obviously something has happened that is affecting the caching plugin i’ve got installed. Might just have to disable that for a while.

Edit:After unplugging the plugin and refreshing any browsers open, it now isn’t appearing on the site, but still appears in the admin panel, which hopefully is just because the admin panel cache hasn’t been cleared ..

Actually, I have no idea what I’m talking about really .. just hoping that turning it off will fix this for the moment.

Anyway, here’s to taking the gremlins off-world!

Trouble, Trouble ..

Edit (2):

Have discovered more .. it seems that the header.php page is definately the culprit. Javascript calls, wp_head(), and some links all contribute to the long load time. Will set about cleaning it up when I get some time.

Edit (1):

After some preliminary testing, it seems whatever is initiated in the header.php and footer.php files is the major culprit. Take those away, and we load in about 1.2 seconds.

Of course, no css (and whatever else) means it’s a plain looking site.

More later.

Not sure if it’s my pc. I don’t want to think about the possibility of my new hosting being the problem.

But.

Dev Dawn is having issues.

I’ve been trying to clean up the front page, so that it loads faster. I’ve removed a bunch of stuff out of the Sidebar. It should theoretically work.

The problem is, that I can make changes immediately to the database, which should show up, or even to the files themselves, via ftp, and it takes a long time to show.

I’m contemplating going back to basics.

Dev Dawn today has taken an average of 10 seconds, or thereabouts, to load. That is woeful.

More on this later,

Redirect The Rage

Last night I was doing some contract web work, and discovered just how easy it is to put some redirection into place. I realise this will be bread & butter knowledge to most webfolk.

If you have more than one (or maybe even just one) domain name that is pointing to the same IP, and you wish to redirect the user based on the address they typed, there is a simple way.

Following is the code that I knocked up last night. It works for files in the same directory (the include), and for places outside (the header redirect).

One NUB mistake I made was putting my initial comments in html comment at the top. Bad Bad Bad! The header function has to come before any html. Man alive. No0b. Newb.

< ?php

/*************/

/* index.php */

/*************/

/* Created: 06-04-19 Purpose: This is the Redirect file. It simply processes the domain name the user has entered, and redirects accordingly. */

/* Get the "Domain Name" */

$ServerName = $_SERVER[‘SERVER_NAME’];

/* Redirect to main Index */

if (strstr($ServerName,"mysite001.com") || strstr($ServerName,"mysite001.com.au")) { include(‘index.html’); }

/* Forums redirect */

elseif (strstr($ServerName,"mysite002.com")) {

//include(‘http://www.mysite002.com/forum/index.php’); /* this doesn’t work, needs a physical redirect rather than the include */

header("Location: http://www.mysite002.com/forum/index.php"); /* Redirect browser */

}

/* CatchAll … this doesn’t have to be the main Index, but is for the moment */

else { include(‘index.html’); };?>

There you have it. Not much to it. This assume that apache (or whatever server) will take a gander at the index.php file first. If it doesn’t, you can either change the way apache looks (want to put the .php first in the http.conf file (i think that’s the one from memory), or just don’t have any other index. files … if you have an index.html, change it to indexmain.html .. or something along those lines.

Cheers, thanks for listening, you’ve been a wonderful audience,