Allowed memory size of 8388608 bytes exhausted

When trying to automatically upgrade a blog from 2.8.1 to 2.8.2 it wouldn’t work and I saw an error message similar to this: Allowed memory size of 33554432 bytes exhausted. It seems the error is pretty common and I found the solutions on the WordPress.org support forums. In my case it was an active plugin causing the problem. I started deactivated one plugin at a time and trying the automatic upgrade after each one. It wasn’t until the 8th deactivated plugin, Contact Form, that the automatic upgrade worked.


So if you are getting the same type of error you most likely have an offending plugin or group of plugins and I suggest deactivating all plugins before the upgrade. You can also try what I did and see what plugin is causing the problem. Keep in mind it might not be just the last deactivated plugin but the combination of two or more plugins.
Another solution that I didn’t try but others have had success with is increasing the WordPress memory limit. To increase the memory limit add this bit of code in the wp-config.php file right after the opening php statement:


define(‘WP_MEMORY_LIMIT’, ’64M’);

If you don’t know how to edit a core WordPress file, sorry I am not going to get into it in this post and I suggest you stick to the deactivating plugins solution or check out more on the topic at the WordPress.org Forum.

I host with MediaTemple, so they let me change my own PHP.INI file. Some hosts don’t, and will limit your memory limit allowed for php calls. If you can edit your php.ini, add this.

memory_limit 32M

Then, add this to your .htaccess file.

php_value memory_limit 32M

This fixed that error for me.

Leave a comment