How to fix the WordPress upgrade Out of Memory error

If you are on a shared host such as 1and1, and try to upgrade your WordPress installation via the automatic update method in the admin panel, you may run into the following error: “Fatal error: Out of memory”.  This error is the result of 1and1’s shared hosting memory limitations for PHP.

There are a number of options that you can experiment with to resolve the issue.

Option One: The easy road, but less reliable…

The first, and easiest option is to disable all of your plugins, then try the automatic upgrade.

Option Two: A little more complex, but will not be over-written upon another update

The second option is a bit more complex, but not overly difficult.  This option requires you to to override the default PHP memory limit.  Fortunately, this is quite easy to do by use of a small php.ini file placed in the root directory of your site.  Here are the steps…

  1. Create a new text file called php.ini.
  2. Open the file in a text editor such as Notepad or Notepad++.
  3. Add this line to the file: memory_limit=48M
  4. Using the 1and1 web-space explorer or an FTP application, upload the file to the root directory of your site and to the wp-admin directory of your WordPress installation.
  5. Now, try the automatic update again.  It should complete without error.

Option Three: More complex and might be overwritten

The third option requires you to modify some of your WordPress code.  I think that this is a less than desireable option, since any changes that you make in this manner may be over-written upon the next upgrade of WordPress…  Here are the steps for this option:

  1. Open up the wp-config.php file in a text editor.  You may need to use an FTP client such as FileZilla to download the file to your computer…
  2. Add the line “define(‘WP_MEMORY_LIMIT’, ’64M’);” to the top of the file, right before the line containing “require_once(ABSPATH . ‘wp-settings.php’);
  3. Upload the file back to your server
  4. Now try the update again.

WordPress 3.2 issues…

It appears that the 3.2 version of WordPress is experiencing a similar failure.  Try one of the above options to see if it fixes your issue.   Always remember to back your site and database prior to performing a WordPress update.  Good luck!

Leave a Reply