You can switch between your installed PHP versions in several ways. If you are restricted to use .htacess
, you may add a handler in your .htacess
file. For example if you want to use PHP 4, you can add the following code to your .htacess
file:
AddHandler application/x-httpd-php4 .php .php4 .php3
For PHP 5.0 you can use:
AddHandler application/x-httpd-php5 .php .php5 .php4 .php3
For PHP 5.1 you can use:
AddHandler application/x-httpd-php51 .php .php5 .php4 .php3
Similarly for PHP 5.2 and 5.3. If you want PHP 5.2 with Suhosin patch use:
AddHandler application/x-httpd-php52s .php .php5 .php4 .php3
The answer can be found in the following links:
https://stackoverflow.com/questions/12105632/change-php-version-on-server-using-either-htaccess-or-php-ini
http://docs.1h.com/How_to_switch_PHP_versions