Knowledge Base Article

How to switch to a different Php version?

SiteGround has recently introduced a unique server setup that allows each customer to choose which version of PHP to use for his / her account. What is more the customer can even use different PHP versions for different directories in one and the same hosting account.  The PHP versions currently supported are: PHP 5.0,  PHP 5.1 and PHP 5.2 (the latest stabled branches).

In order to change the PHP version for your account, follow these steps. Go to cPanel, File Manager and choose "Web Root (public_html/www)". There create a new file called .htaccess containing the following line:

 

To switch to PHP 5.0:

AddHandler application/x-httpd-php5 .php .php5 .php4 .php3


To switch to PHP 5.1:

AddHandler application/x-httpd-php51 .php .php5 .php4 .php3

 

To switch to PHP 5.2:

AddHandler application/x-httpd-php52 .php .php5 .php4 .php3


This setting will apply recursively to all of the subdirectories. In case you'd like to have a different version of PHP in a subdirectory, create a new .htaccess file in it with the directive for the desired PHP directive in it.



Rating

Please indicate if this article was helpful for you.

rating :  4.0 from 5
views :  4823
votes :  169

Valid XHTML 1.0 Strict Valid CSS!