WordPress upgrade error (Allowed memory size of 33554432 bytes exhausted)

The problem

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 2516315 bytes) in /home/mydomain/public_html/blog/wp-includes/http.php on line 1370

This can happen at any line and with any file, not only http.php at line 1370!


Don’t worry if you get this error, there is nothing wrong with your server or hosting plan etc. Whenever a new version of WordPress is released, new features are added, thus more calculations, so logically more memory is needed.
In older versions of WordPress (before 2.7… I think), the memory limit was set to 32M, if you are upgrading WordPress, you will probably get that error, you will have to edit the wp-settings.php file and set (I should say change) the constant WP_MEMORY_LIMIT value to 64M, giving PHP more memory to play with.

The solution

  • Open the remote file wp-settings.php file located on the base directory where you installed your WP blog
  • find this code (probably at line 13)

    define('WP_MEMORY_LIMIT', '32M');

  • Replace with

    define('WP_MEMORY_LIMIT', '64M');

  • Run the upgrade process again
  • Enjoy your updated WP blog

3 thoughts on “WordPress upgrade error (Allowed memory size of 33554432 bytes exhausted)

Thank you so much for that. I have a few blogs with this issue. I thought it was my server under too much load but this sorted it straight away.

Thanks again its spot on.

P.S. Make sure the ‘M’ is at the end as I missed it the first time!

You can still encounter this error if WP_MEMORY_LIMIT is also defined on your wp-config.php file.

The same modification to the code can be applied here.


Leave a Reply

Your email address will not be published. Required fields are marked *