So, some of you might remember the little accident that used to happen with my Spam Karma 2 plugin, causing commenters to receive a message, somewhat along the lines of: Fatal Error = Memory Exhausted (tried to locate … bytes) etc. Little did I know this problem had to do with the initial memory size set by my host for scripts. And it was only till last night, when I upgraded WordPress and kept receiving the same error all over again, that I was able to find out what exactly was going on.
Cpanel’s PHP Settings helped me out a lot. Apparently, 8 MB by default was given to host a script; meaning that if any script (and a WP-based website is basically one big script) crossed the maximum limit, it would display the message I received lately. Now, after some digging around on the WP Help website, I figured out how to solve the problem. Since I hope this small article might help other people with the same problems, I shall explain it to you.
One tip given on the WP Forum was: create a .htaccess file and display a certain code in it. This totally failed, because the only result was a 500 Internal Server Error. So, I would advice you not to use this method.
The only thing that helped from me (since trying to create my own php.ini file messed up terribly too) was adding the following code in my cache.php (nested under /wp-includes/cache.php) right underneat the beginning <? php tag.
ini_set(’memory_limit’,'32M’);
I set the value to 32 M for safety (I do not want this error to come up again!) However, if you feel like it, you can also set it to 16 M or whatever value you want (although it is probably best if you choose one higher than the one you already have, which is in most cases 8 MB).
Now, to give you another last example of how your cache.php should look like now (the top part):
ini_set(’memory_limit’,'32M’);
function wp_cache_add($key, $data, $flag = ”, $expire = 0) {
global $wp_object_cache;
$data = unserialize(serialize($data));return $wp_object_cache->add($key, $data, $flag, $expire);
}
I hope you all enjoyed this small article and I hope it was helpful to some people. I know it is short, but why make it long and complicated if you can make it easy?

January 27th, 2008 at 3:07 am
That probably is helpful to a lot of people. Meh, if something was wrong with my WP I wouldn’t be able to figure out the solution by myself haha.
January 27th, 2008 at 11:19 pm
Awwww, I love this layout! Simple but sexy, now I want to change my layout lol.
January 28th, 2008 at 7:22 pm
Thanks Zatanna! I really like this layout too, especially the colours. And like you said, simply and sexy.