Facebook Twitter Gplus RSS
Payday loans uk
formats

WordPress Update Fatal error: Out of memory *FIX*

Published on January 28, 2011, by in Wordpress.

So I was banging my head against the wall with this error and have upgraded my site manually the last couple times but this time I decided to dig a little into the error and see if I could finally resolve this.

I found the normal articles about increasing the PHP memory in various places but like most of us I don’t host my website, 1and1 hosting is my preferred host so there isn’t much I could do about the php.ini file now is there? Well actually with 1and1 they give you control over your .htaccess file and you can create additional php.ini files in any directory and 1and1 will prefer your changes in your file.

I first followed an article which suggested creating a php.ini file and adding to both the root directory and the wp-admin directory with this following

memory_limit = 42M

This didn’t make any difference and I didn’t think it would considering the default memory allocation according to my phpinfo file as already 40MB.

~sidenote: If you want to know your current PHP.ini file configuration settings you can simply create a new file called PHPinfo.php and add the following lines

<?php
phpinfo ();
?>

Upload the file via FTP to your website root directory. Now navigate to www.yoursite.com/phpinfo.php and you should see a nice PHP Info webpage.

I did notice however that the following items were also changed when I used my new php.ini file.
OLD

browscap=/usr/lib/browscap.ini
max_execution_time=50000
upload_max_filesize=20M

NEW

browscap=no value
max_execution_time=30
upload_max_filesize=2M

So if you plan to change the PHP memory limit I recommend taking note of anything else that changes so you can set it back.

My next item of recommendation was to change the wp-config.php file located in the WordPress root directory by adding the following line.

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

I added the line and tried again with no dice. Next up on the list was adding a line to the .htaccess file which caused my site to not load at all. I also tried a plugin automatic upgrader and several other options all with no luck.

The final solution was to deactivate all of my plugins and then apply the automatic upgrade, I first deleted all of my inactive plugins so I wouldn’t get confused as to which were activated, then I grabbed them all and applied a bulk deactivate action on them. This allowed the update to work without any issues, however I never did remove the php.ini file so I figured I would leave that part in the article in case it did help out the situation. Since the update is applied I cant go back and try again, not until next time anyway.

Thats all, good luck and I hope this works for you.


If you found this article helpful please donate, I appreciate anything including pennies.
[donateplus]


Related posts:

  1. WordPress – Sticky a Post on the HomepageI will explain how to keep a post on the top of your homepage for those of you who want to keep a welcome to my blog style post first on your home page. It’s extremely easy and your going to kick yourself after I tell you how to do...
  2. WordPress wp_get_archives from specific category ?While trying to figure out how I could show posts from two categories but always keep one category on top I finally gave up. The best I could find was to run multiple custom queries using rewind_posts() but even this was difficult to carry from theme to theme as I...
  3. WordPress show Post Excerpts + ThumbnailsThis article will show you a couple methods for showing excerpts from posts on the homepage, for searches and for archives. First I will show you the manual method of editing the WordPress theme code to accomplish this but I urge you to read on as their is a much...
  4. WordPress create a custom Sidebar Posts QueryI have been trying to learn how to make my own custom WordPress sidebar widgets because every theme uses their own custom layout and I prefer a specific layout which I can only acomplish by manually editing the WordPress theme sidebar PHP file. In this post I will show you...
  5. WordPress prompts for FTP credentials when trying to update plugins and themesThere is a simple fix for this annoying prompt and I will cut to the short of it. FTP to your WordPress installation directory and copy the wp-config.php to your local machine. Open the file in your favorite editor and paste the following code right into the file near the top...

4 Responses

  1. Thank you so much for posting this.

    I had been going round in circles with this until I came across your post.

    Excellent. Worked a charm for me.

    Regards

    Nigel

  2. Hi David, thank you so much for the fix.

    I had one last site which was suffering from the problem and like you tried all the other suggested solutions without success. If only I had found your post first I would have saved days of work!

    Thanks a lot

    Bruce

  3. pflorin

    It didnt work for me even with 128MB and Im not going to deactivate all the plugins.

    Does everyone have Contact 7 form installed?? It might be because of that plugin.

  4. mloddf

    Thanks for the post, but all of the things didn’t work for me. I disabled all the plugins, I deleted the ones that were not used. I also deleted the Contact 7 form, but that didn’t help, too.
    Tried to update from WP 2.9.1 to 3.4.1. Why me??? Still going round in circles. :-(

Home Articles Wordpress WordPress Update Fatal error: Out of memory *FIX*