How can I use PHP5 with my web hosting plan?

There is no general rule how to switch between PHP versions. At first, make sure that your web host provides PHP5 at all. Then, try one of the following solutions:

a. A couple of web hosts allow to choose the PHP version via the control panel.

b. Some web hosts allow to choose the PHP version via Apache handler (works on Apache servers only). In this case, put a .htaccess file into the root folder of your website and add the following line:

AddHandler x-httpd-php5 .php

c. If you are allowed to use Apache's mod_rewrite, you can rewrite *.php files to *.php5 files. Simply create a .htaccess file, put it into the root folder of your website and add the following lines:

RewriteEngine on
RewriteRule ^(.*).php$ $1.php5

Last update on 2008-08-04 by Leo Feyer.

Go back