Upgrading WordPress with 1and1 Hosting – Fatal error: Out of memory (allocated 22806528) (tried to allocate 5440754 bytes)
If you are reading this post and your hosing is provided by 1and1.com then you have noticed the problems that arise when you try to upgrade your WordPress installation. Unfortunately, this is not something that you can skip as 1and1 plans to disable PHP4 support on August 1, 2013, and keep only PHP5. I listed the related issues and how to solve them below.
WordPress is Stuck at Downloading Update
This is the first issue that you will most likely face. When you go to Settings -> Update and try to update automatically the only thing that happens is that the message “Downloading update from…” is displayed and nothing else happens.
As 1and1 has switched to PHP5 automatically you have most likely switched to using PHP4 in order to workaround bugs with your script. Check your .htaccess files for:
AddHandler x-mapp-php4 .php .php4
make sure to remove that line or change it to:
AddHandler x-mapp-php5 .php .php4
This makes PHP5 default for the scripts in the folder where the .htaccess is located.
Once you make the above changes this issue should be resolved and most likely you will face the next issue.
Fatal error: Out of memory (allocated 22806528) (tried to allocate 5440754 bytes)
The values above may vary for different WordPress versions and hosting packages, but generally the message is the same – there is no sufficient memory. I know you have read a lot of pages and solution already and none of them worked so listen carefully.
1. Find the file wp-config.php it should be located at the root of your blog. Open the file and after the first line that contains: <?php
insert define(‘WP_MEMORY_LIMIT’, ’64M’);
save the changes and upload the file.
2. Create a new text files with the name php.ini inside that file paste this text:
memory_limit = 90M
save the changes and upload the file in the root of your WordPress installation and inside the wp-admin folder!
3. Try the update process and everything should be working flawlessly.
Cannot send session cookie – headers already sent by
You will most likely not face this issue. This error may be displayed if you are using WordPress functions from your own script. If you have used this with PHP4 you have most likely inserted: <?php session_start();?> in order to prevent errors. Take a look at the beginning of your script file and remove the call to the function session_start();. This should fix the error.
Do not forget to backup your files and database before trying any update procedures. The above method will not damage your existing installation and will update both your existing database and WordPress version if everything goes as planned. Of course something can always go wrong so do not rely on chance and spend 5 minutes for backup.
How to backup WordPress at 1and1
- Log in to your control panel
- Go to Web Space->”MySQL Administration”
- In the databases list find the one that is used for WordPress and click the phpMyAdmin button next to it.
- The database information will be listed in the phpMyAdmin page. Follow the link with the title “Export”. Do not alter any settings except “Compression”->”gzipped” – this will make the backup a lot smaller. Click “Go” and save the exported database to your computer
- Do not forget that you have to backup also the images that you have used in your posts and also the themes that you may have modified. It is best to use an FTP client and download your entire WordPress Folder. If you are more experienced you can use and SSH client like PUTTY, go to the folder and create an archive using tgz. Then you can download the archived file using FTP as this will be WAY faster.
I hope this article will save a lot of time and headaches for you. Drop me a line in the comments.