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.
browscap=/usr/lib/browscap.ini max_execution_time=50000 upload_max_filesize=20M
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.