Running PHP 5 for WordPress with 1&1 Hosting

Update: 1&1 Hosting Transition to PHP5

If you are on a shared hosting plan with 1&1 it’s relatively easy to create a new MySQL Database for your WordPress installation.

Creating Your New Database

Just sign into your account and navigate to Web Space & Access and then to MySQL Administration. Click on “New Database” and you will be prompted to name your new database along with the option of choosing between MySQL 4.0 and MySQL 5.0 for your new database. WordPress Requirements state that WordPress need PHP 4.3 or higher to function properly although a few plugins require that you use PHP 5 to function. Choose MySQL 5 and your database will begin setup.

Since we created a new database and chose the option of MySQL 5 your database is using PHP 5 for WordPress right? Unfortunately that’s not the case.

Checking Your PHP Version by Creating a phpinfo.php File

1&1 will have your new database running PHP 4.4.9. Easiest way to check what version of PHP you are running is to create a phpinfo.php file and insert only the following into your file.

<?php
phpinfo();
?>

Upload this file to your directory and open phpinfo.php in your web browser.

The information at the top of this window will display the version of PHP that you are running.

Forcing 1&1 to Use PHP 5

It only takes 2 lines added to your .htaccess to force 1&1 to use a version of PHP 5. Add the following to the first 2 lines in your .htaccess file. Your .htaccess file will be in your root directory for your installation, it may be hidden so in your FTP program see if there is an option to display hidden files.

AddType x-mapp-php5 .php
AddHandler x-mapp-php5 .php

Once you make the edits to your .htaccess upload it to your directory and once again open phpinfo.php in your web browser. You should now be able to see that your database is using PHP 5.

Quick Tip from JG in the comments:
I found once I updated the .htaccess file, then all my links would break from the homepage. What I did was go to the permalinks page under settings and click ’save changes’. You don’t have to actually change anything.

Then when I found pages that wouldn’t load, simply refreshing the page made them work again.

02. February 2009 by Gabe Diaz
Categories: Blog | Tags: , , | 60 comments