I am a great fan of using WordPress not only to run blogs, but also as a Content Management System. The team behind WordPress ensure that the software is updated regularly, adding new features and bug fixes. When I came recently to updating this blog to version 3 of WordPress, I encountered an issue that I hadn’t seen before with WordPress and in particular on the 1and1 hosting that it uses. To be more precise it is the way 1and1 (oneandone) handles or parses php files
Error 500 – Internal server error An internal server error has occurred! Please try again later.
It didn’t take long to track the problem down to the way 1and1 hosting parses php files. By default 1and1 will use PHP version 4 to parse scripts. It seems that WordPress 3 requires part of its program to run through PHP5. To tell 1and1 hosting that you want php files parsed with version 5 of PHP, follow the steps below by creating an htaccess file with some special commands
- Create a new text file, using Notepad
- Add the following code to the top of the file, save it, and name it as htaccess.txt
AddType x-mapp-php5 .php AddHandler x-mapp-php5 .php
- Upload your modified htaccess.txt file into your wordpress root folder using FTP
- Rename the htaccess file, using your FTP program, from htaccess.txt to .htaccess (notice the dot before htaccess, that is important)
- Go back to WordPress and test
- Note that you may already have an .htaccess file sitting in your WordPress root folder, if so, FTP the file from your 1and1 hosting to your computer and add the two lines above to the end of the htaccess file, then upload again, overwriting the original htaccess file. (you may want to rename the original htaccess file before overwriting, just in case)
From now on any php scripts that are served out of your WordPress root folder will be processed by PHP5.
This is a common problem with 1and1 hosting, but one which is easily solved and not only works for wordpress but for any other script, such as content management systems, social networking scripts (elgg) etc.
11 Comments
barty
July 10, 2010 at 5:12 amdidn’t work
admin
July 17, 2010 at 6:33 pmSorry barty, without any more information from you I cannot help. Check your error log for more info.
Bill Hollings
July 19, 2010 at 8:55 pmThanks for the detective work, clear explanation, and solution!
I encountered exactly the same problem after activating a particular plug-in under WP 3.0 on 1and1, and your fix seems to have solved it for me.
Thanks again…
…Bill
admin
July 19, 2010 at 10:20 pmNo problem. This situation is not just applicable to wordpress, but to any script (such as content management) that runs on PHP5.
JohnH
July 20, 2010 at 9:11 amThanks very much , i’d struggled for days with this and its now sorted. All down to 1and1 as you suggest, but this fix worked for me. Cheers
Tim
July 25, 2010 at 7:36 amThanks so much for sharing this… worked for me! 🙂
druo
July 29, 2010 at 9:53 amit didn’t worked for me!
but thank u at all.
Joshua
July 29, 2010 at 6:49 pmThanks a ton! Worked perfect for me, this is what I have in my .htaccess file now for anyone curious:
# BEGIN WordPress
AddType x-mapp-php5 .php
AddHandler x-mapp-php5 .php
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
bourne
August 11, 2010 at 8:00 amThanks for the help – your advice worked like a charm 🙂 much appreciated.
Artiom
August 21, 2010 at 7:00 amThank you so much! This worked for me!
Josh
September 9, 2010 at 1:23 amThank you very much for posting this! Worked great – I have been looking for a solution to this for a while now. Thanks!