Upgrading to WordPress – The Dreaded “Out of Memory” Error

by Michele on September 30, 2010

in WordPress Plugins

Was recently upgrading one of the 20+ WordPress sites that I manage, and for the first time ever, I encountered a new and unusual error.

The Automatic Upgrade Derailed

The automatic upgrade, which has been absolutely smooth and trouble-free in every instance threw this error:

Downloading update from http://wordpress.org/wordpress-3.0.1.zip.

Fatal error: Out of memory (allocated 26214400) (tried to allocate 2966269 bytes) in /home/XXXXX/public_html/XXXXX/wp-includes/http.php on line 1363

The Solution

Doing a few quick searches uncovered this solution:

http://wordpress.org/support/topic/fatal-error-on-upgrade-allowed-memory-size-exhausted

and this:

http://wordpress.org/support/topic/fatal-error-allowed-memory-size-6?replies=13

Basically, you need to add a line to the wp-config.php file, at the very top, right after the opening

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

However, when this didn’t solve the issue, it was clear that something else needed to be done.

I also manage a number of Drupal sites, more in the capacity of technical project management, and I can say from considerable experience that upgrades of this nature in Drupal are quite a different story.

Basically, every time a security patch, core system upgrade, or module upgrade is issued, the upgrade process involves many hours of line-by-line debugging with each module, with a healthy measure of hand-wringing, angst, and soul-searching.

Spoiled as we are by WordPress, where even the most custom site from 5-6 versions ago can easily be upgraded at the press of a button, best practices can easily be ignored.

Back when we were dealing with WordPress 2.2-2.6, before every upgrade, you had to carefully back up the database and site files, disable all plugins, and then run the installer.

Well, taking a cue from that, I simply disabled all plugins, and tried the auto-updater again.

Presto – WordPress automatically updated itself.

Then it was just a matter of updating and re-enabling the recently-active plugins.

Ultimately, this just shows how truly user-friendly WordPress has become – even extremely technically-challenged users can manage the software, and attempt to do very sophisticated actions like base CMS system upgrades, mostly without a hitch.

Note to users – it does help to follow the protocols:

http://codex.wordpress.org/Upgrading_WordPress

  1. Back up your database
  2. Back up your files
  3. Disable plugins
  4. Update!

Just be thankful you’re working with WordPress as opposed to Drupal; just check out the process for Drupal upgrades:

http://drupal.org/upgrade

I have great respect for my Drupal friends, in particular my buddy Aaron Wolfe – cheers, mate!

UPDATE – Keep in mind, this isn’t just for WordPress 3.0.1 – it’s important for ANY WordPress upgrade…

  • Delicious
  • Facebook
  • Digg
  • Reddit
  • StumbleUpon
  • Twitter

{ 2 comments… read them below or add one }

Carlos December 19, 2010 at 11:38 am

Thanks for this post. It helped so much.

Michele December 30, 2010 at 12:11 pm

Carlos – Glad I was able to help. This isn’t limited to WP 3.0.1, either – it can happen on any upgrade…

Leave a Comment

Previous post:

Next post: