WP-Cache Error & WordPress Login Error?

Are you seeing this error message at the top of every page of your WordPress blog? (The fix is below…)

Warning: sem_get() [function.sem-get]: failed for key 0x152b: Permission denied in /home/username/public_html/wp-content/plugins/wp-cache/wp-cache-phase2.php on line 98

You might also be getting something like this at the foot of every page too:-

Warning: sem_acquire(): supplied argument is not a valid SysV semaphore resource in /home/username/public_html/wp-content/plugins/wp-cache/wp-cache-phase2.php on line 107

You’re not the only one. Google is full of sites showing this error (about 50,000 pages on this quick search):-

If you’re seeing this error, you probably can’t log in to the admin area of your blog either! Here’s how to fix it.

How To Fix It Fast

The error is coming from one of your plugins called WP-Cache. It’s the plugin that is supposed to help speed up your blog. But this plugin is now very old and hasn’t been updated for years. (For a better one keep reading below).

1. Get Your Blog Working

Top priority – let’s make this error go away.

You need to disable that plugin. You probably can’t login to the WordPress admin area due to the same error. But you can get round this by editing your WordPress config file (wp-config.php) which you’ll find in the folder you installed your blog.

NOTE: be very careful editing this file, as you can break your blog even more. I recommend you keep a backup copy before making any changes.

Edit the wp-config.php file and remove this line:-

define('WP_CACHE', true);

(If your host uses cpanel, you can edit using the built in code editor. Otherwise download using FTP, edit, then upload the amended version)

You should now be able to log in to your blog admin area. Now go to your plugins and disable WP Cache.

Your blog should now be functioning normally without showing any errors.

2. Now Install WP Super Cache

If your blog gets very little traffic, you may want to leave it at that. Especially as installing WP Super Cache isn’t particularly easy.

WP Super Cache does what WP Cache used to do well. The most critical difference being that WP Super Cache is still actively being developed. Which is important when WordPress keeps changing and improving all the time.

You can download it here:-
http://wordpress.org/extend/plugins/wp-super-cache/

NOTE: Follow the install instructions in the Read Me very closely. Especially the instructions about removing left over traces of the old WP Cache.

3. Please Link To This Page

If this fixed your problem, please send a link to this page. It will help the other 50,000 or so blogs suffering the same thing! Thanks.

So Why The Errors?

In short, I don’t know yet. But I’d be interested to hear if anyone knows?

I’ve seen a whole bunch of blogs all suddenly display this error. Those blogs were all hosted with Bluehost, so maybe a change Bluehost have made has caused WP Cache to fail? That’s not to say it’s the fault of Bluehost as WP Cache is old and unsupported code.

Have you seen this error on your Bluehost blogs? Or on blogs hosted elsewhere?

Or do you know what is causing the errors?

Please leave a comment below. Thanks.

/home/username/public_html/

6 thoughts on “WP-Cache Error & WordPress Login Error?”

  1. Thanks for the post. I was doing some developing work for the website that I update on a regular basis and noticed that I had disabled the cache module temporarily, but forgot to turn it back on.

    Went to do so, and bang. No more admin screen. 🙁

    Glad I found this post – deleted the line in the config module and went to my bookmarked log in site. Didn’t even ask me to log back in – went right to the admin screen. I disabled and deleted the offending plugin, and things are back to normal. (Immediately made a DB backup, too.)

    The site is hosted by Bluehost, and this is my first real problem with the module. It’s still unclear where the conflict was… but that’s incidental. Main thing is that the site is working again.

    Low traffic on the site for the moment, and considering it was working very fast without the cache module for however long I had it disabled, I’ll probably leave it uncached for the time being.

    Should that change, I’ll start up with the SuperCache module.

    Cheers!

  2. Allright, I know this is an old post but I still want to reply to it.

    Disabling the plugin can’t be called a fix.

    Just go to your wp-content folder and look for the wp-cache config file.

    Get rid of the // before $use_flock and the problem is solved 😉

    1. I agree. But my ‘fix’ was to stop using ‘WP Cache’ as it’s so old and switch to something that’s still supported 🙂

      Switching file locking on does seem to fix this for some users, so I agree it’s worth a shot to get your blog up and running. So thanks for the pointer.

      But I’d still then recommend moving over to ‘WP Super Cache’, or one of the even newer and fancier caching plugins – W3 Total Cache or Hyper Cache. They should all prove a fair bit faster than ‘WP Cache’.

  3. Switching to a supported plugin is indeed a good plan, normally.

    The problem is, W3 Total Cache doesn’t work with my blog, Hyper Cache doesn’t make my blog faster (loadtime 21 sec) and WP Super Cache gives me blank screen of death when I click a post.

    Maybe this is because I use custom post types, I don’t know.

    The only thing that works for me is WP Cache in combination with Widget Cache.

Leave a Reply to Martin Cancel reply

Your email address will not be published. Required fields are marked *