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]
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
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
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.
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. 🙁