I'm stuck trying to figure out what seems to be a very common problem, the above mentioned "Allowed memory size of (...) exhausted". After developing my first theme I was moving it (just the theme, not the whole WP installation) from my development computer to my production server. After installing WP everything seemed fine and the site was working great with the default theme. Upon activating my custom theme however WP started throwing the error,
PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 523800 bytes) in /srv/www/my.domain.com/public_html/wp-includes/cache.php on line 113
Worth mentioning is that I've never had any issues like this during development.
I've tried to increase both the memory limit in php.ini as well as setting the WP_MEMORY_LIMIT constant in wp-config without luck.
php -i | grep memory
memory_limit => 128M => 128M
cat wp-config.php | grep MEMORY
define('WP_MEMORY_LIMIT', '128M');
As you can see I've worked my way up to 128M. Still hitting the error I'm thinking this is getting ridiculous and not likely the source of my problem. As far as I can recall I never had to go much beyond 32M on much larger WP installations in the past.
ini_set( 'memory_limit', WP_MEMORY_LIMIT );
after your settings in the wp-config.php.for
foreach
while
which are allocating memory. Chances are you have an infinite loop somewhere in your code.