Soon after i got a WordPress blog running i started getting a Fatal Memory error that i had no clue how to solve. After some researching on Google i found the cause to be the plugins i was running in my theme. What sucked most about this mess was that i had lost all ability to access my Dashboard and thus remove the plugins.
Luckily, i found that the trick to restoring my dashboard was to increase PHP memory for cache. There are 3 basic steps that helped me get rid of this error:
- Open the file
wp-includes/cache.phpand place the following code immediately after the opening<?phptag: - After that, create an htaccess file for the
wp-includesdirectory and insert the following directive: - Finally, create a local
php.inifile in the same directory (wp-includes) and insert this:
ini_set('memory_limit','64M'); // set memory to prevent fatal errors
# set memory limit for cache.php
php_value memory_limit 64M
;; set memory limit for cache.php
memory_limit = 64M
These steps should help get rid of the memory error. Remember, when upgrading WordPress installations, the cache.php file must be modified again.
Related posts:
Twitter
Facebook
LinkedIn
Disqus
Digg
Delicious
Last.fm
Google Reader
Kevinkorb 1779 This runs as a cron job and notifies the administrator of all the php fatal errors that happened in the last specified time. Blog Hosting
Thank you so much for this. I came here by Googling the error for a site I’m developing for a local theatre company (not my main one).
For some reason, I couldn’t do the step for editing the .htaccess file (probably my web host’s online editor crashing) — but it didn’t matter, because the first step got me back up and running somehow.
That’s true – should have added that. Most of the time only step 1 is required and you’re set. This is truly painful though
very useful post. I would love to follow you on twitter.