Change PHP version for a specific domain on a hosting account
Author: admin admin Reference Number: AA-00391 Views: 8483 Created: 2013-05-09 08:48 Last Updated: 2017-08-07 12:36 0 Rating/ Voters

If one domain / script on your hosting account required a different version of php never fear !

----------------------------------------------------------------------

To change to version 5.2 of php add the following to a .htaccess file  in the folder where the domain / script exists :

AddHandler application/x-httpd-php52 .php
suPHP_ConfigPath /usr/local/lib/php52/

----------------------------------------------------------------------

To change to version 5.3 of php add the following to a .htaccess file  in the folder where the domain / script exists :

AddHandler application/x-httpd-php53 .php
suPHP_ConfigPath /usr/local/lib/php53/

----------------------------------------------------------------------

To change to version 5.4 of php add the following to a .htaccess file  in the folder where the domain / script exists :

AddHandler application/x-httpd-php54 .php
suPHP_ConfigPath /usr/local/lib/php54/

----------------------------------------------------------------------

To change to version 5.5 of php add the following to a .htaccess file  in the folder where the domain / script exists :

AddHandler application/x-httpd-php55 .php
suPHP_ConfigPath /usr/local/lib/php55/

----------------------------------------------------------------------

To change to version 5.6 of php add the following to a .htaccess file  in the folder where the domain / script exists :

AddHandler application/x-httpd-php56 .php
suPHP_ConfigPath /usr/local/lib/php56/

---------------------------------------------------------------------

To change to version 7.x of php add the following to a .htaccess file  in the folder where the domain / script exists :

AddHandler application/x-httpd-php70 .php
---------------------------------------------------------------------


As soon as these lines are added to the .htaccess file then that folder will then use the defined version of php !


Please use the following syntax if the above didn't work : 

AddHandler application/x-httpd-ea-phpXX .php

where XX is the php version, for example :

for php 5.5 :

AddHandler application/x-httpd-ea-php55 .php

for php 5.6 :

AddHandler application/x-httpd-ea-php56 .php

for php 7.0 :

AddHandler application/x-httpd-ea-php70 .php


Quick Jump Menu