How to edit .htaccess file and make a site work with different php version



Instruct your server admin to install side-by-side PHP handlers.

Step 2:

You can now use them by adding one of the following to the .htaccess file in a site.

Add one of the following sets of code, depending on the version you want to use:

  # Use PHP 5.2
AddHandler application/x-httpd-php52 .php
suPHP_ConfigPath /opt/php52/lib

# Use PHP 5.3
AddHandler application/x-httpd-php53 .php
suPHP_ConfigPath /opt/php53/lib

# Use PHP 5.4
AddHandler application/x-httpd-php54 .php
suPHP_ConfigPath /opt/php54/lib

# Use PHP 5.5
AddHandler application/x-httpd-php55 .php
suPHP_ConfigPath /opt/php55/lib