Fatal error: Allowed memory size exhausted in WordPress 3.0 upgrade

24. 08. 2010 at 21:41

Have you upgraded to WordPress 3.0 and got the following message when trying to automatically update to 3.01?

Fatal error: Allowed memory size of xxxxxxxx bytes exhausted (tried to allocate xxxxxxxxx bytes)

I used to get that error on older versions of WordPress from time to time and resolved it by editing the wp-settings.php file. There’s a line that says define(‘WP_MEMORY_LIMIT’, ’32M’); and a quick edit to define(‘WP_MEMORY_LIMIT’, ’64M’); used to sort the problem out.

But on a recent attempt to upgrade from 3.0 to 3.01 I got the error and found the memory allocation in the wp-settings.php file is split out as an include file on line 20

require( ABSPATH . WPINC . ‘/default-constants.php’ );

and the “default-constants.php” file, with its memory settings is in the wp-includes folder and appears to now be correctly specified at 64M. After some research I found a site that suggested increasing this to 128M, or 256M I tried both and neither worked.

Another site suggested changing the PHP.ini file’s memory from 32M to 64M, but I use Namecheap and I don’t have access to that file.

I finally found the answer that worked for me.

Locate the .htaccess file in the WordPress root folder and add this line:

php_value memory_limit 64M

That worked fine. I hope that helps you too.