Using different PHP versions on your web site

Sometimes it may be necessary to use a different version of PHP on a web folder rather than the default.  This may be when you have an application that only works on later versions of PHP as it contains functions that only work on later versions of PHP.

On some web servers this can be done using AddHandler in an htaccess file in the folder that you want a different version of PHP in.

So for version PHP 5.1

AddHandler application/x-httpd-php5 .php5 .php4 .php .php3 .php2 .phtml
AddType application/x-httpd-php5 .php5 .php4 .php .php3 .php2 .phtml

You should check with your hosting to make sure that this will work of course.

Leave a Reply