WordPress Fix For A Fatal Memory Error

Today while I was upgrading my WordPress installation to version 2.9.1, the upgrade script exited prematurely showing a fatal error as follows :

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

There is an easy fix for this fatal error. The WordPress fix is as follows :

WordPress Fix

The WordPress fix for this fatal memory error is simple. You just have to allocate more memory for wordpress. By default WordPress is configured to use at most 32 MB memory. Here is how you raise this memory limit.

  1. Log into your WordPress hosting directory via FTP. I use FileZilla FTP client for doing this.
  2. Open wp-settings.php in a text editor of your choice. The full path of this file is public_html/wp-settings.php assuming you have installed wordpress in the root of your domain.
  3. Find out the following line :
    define('WP_MEMORY_LIMIT', '32M');
    and change it to …
    define('WP_MEMORY_LIMIT', '64M');
  4. Save the changes you made and upload the wp-settings.php file back to its true location .

Now you can easily upgrade your WordPress software without getting any fatal memory errors.

Note: You can also get Fatal memory errors when you install certain themes that offer  lots of features. The procedure is the same in this case as well.

0saves
If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.

Related posts: