Quick Online Tips
About     Contact
Blogging       Tutorials       Google       SEO       Facebook       Twitter       Apple       Computers       Security       Videos       Downloads

Fix “Allowed Memory Size Exhausted” Errors with WordPress 3.0 Upgrade

A lot of people upgrading to WordPress 3.0 are encountering “Fatal error: Allowed memory size exhausted” errors on their blog and the upgrade fails. There are some solutions which WordPress experts suggest.

“Allowed Memory Size Exhausted” Errors

This is how typically the error looks like

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 2356995 bytes) in /ANY-DIRECTORY/public_html/wp-includes/http.php on line 1331

Why does this happen? Web reports indicate that the size of the download package for WordPress 3.0 is larger than previous versions (due to merger with WordPress MU and new Twenty Ten theme), due to which WordPress needs more memory to download the larger file. Since most web servers have set limit upto 32MB, whenever this is exceeded, the errors occur.

Fix “Allowed Memory Size Exhausted” Errors in WordPress 3

Here are some solutions which WordPress experts suggest.

  • Login your server via FTP (I prefer Filezilla)
  • Download wp-config.php located in the root of your WordPress install
  • Edit it using a text editor like Notepad
  • Add this line after after the <?php tag
    define('WP_MEMORY_LIMIT', '64M');
  • Upload and replace wp-config.php file

All should we working fine now. You can also choose  a value higher than 64 like 128M, but 64 should do the trick. Always keep a backup of the original wp-config.php file incase something goes wrong.

Update: Here is another suggested fix – locate your php.ini file (if it exists), and if it shows 32M, change to 64M:
memory_limit = 64M ; Maximum amount of memory a script may consume (64MB)

But if you don’t have access to PHP.ini try adding this to an .htaccess file:
php_value memory_limit 64M

If all these steps do not work? Then your web hosting provider may have prevented PHP from increasing the memory limit, and you can contact your webhosting support to increase the memory limit for your server.

Use a WordPress PluginMemory Bump is a simple WordPress plugin which can add this line to your wp-config.php file (with 256MB limit) automatically, no PHP file editing manually required. Simply install and activate the WordPress plugin, and the memory limit error will go away (again only if your hosting allows PHP to raise the limit on your account), then you can deactivate once done.

I think WordPress needs to address this memory issue soon, by reducing the package as much as possible, as it will be affecting thousands of WordPress bloggers upgrading WordPress on shared hosting servers.



18 Responses

  1. At times it does n’t work, so here are two work around:
    Edit your php.ini file to increase the memory and if that doesn’t work also, contact your host and ask them to upgrade your memory limit for your hosting account.

    Harsh Agrawal posted on 20/06/2010
  2. Thanks for the tips. But for those people with a provider limiting memory access, and still having problem wi allowed memory size, simply desactivate the plugins during update and it will work fine ;)

    Patrice Albertus posted on 20/06/2010
  3. nice info, but my i know, what is the advantage if we use wp 3.0 with the older… ? i try to update my wp, but, i m scared if my db error n i lost everything (content, themes, links etc). then what should i do if i want to upgrade my wp to 3.0?

    agritwebid posted on 20/06/2010
  4. Thank you for your tips.
    ;)

    Adrian posted on 21/06/2010
  5. Deactivating plugins and reactivating them after upgrade would that not after some plugins that require some setting/configuration like All in One SEO, to working properly, would not have to do the seup again after reactivation the plugins?

    Ewealths posted on 25/06/2010
Twitter   Twitter     RSS Feed readers
Advertisements

Advertise here