SiteGround Tools
1H Section
How to switch to a different PHP version?

How to switch to a different PHP version?

SiteGround has implemented a unique server setup that allows each customer to choose which version of PHP to use for their account. Our customers can also use different PHP versions for different directories in the same hosting account.

The PHP versions currently supported are: PHP 5.6, PHP 7.0, PHP 7.1, PHP 7.2, PHP 7.3. and PHP 7.4.

To change the PHP version in your SiteGround hosting account simply follow the steps below:

  1. Log in to cPanel for your account
  2. Go to 1H Software section -> PHP Version Manager
  3. Navigate to the directory you would like to change the PHP version for (note that the change will apply to subdirectories for it as well)
  4. Click on the directory name
  5. Select the desired PHP version and click Save

You can take advantage of the Managed PHP version service. This means that we will automatically update your PHP version to a newer, stable and secure one when such is available. To apply that, select the Managed PHP Version option and click Save. This will add the following handler in your .htaccess file:

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

This handler will ensure that your websites will always be running on the recommended PHP version without any changes on your end.

You can also apply the changes manually, without using the PHP Version Manager in cPanel. To do so add one of the following directives in the .htaccess file of your website:

To switch to PHP 7.4
AddHandler application/x-httpd-php74 .php .php5 .php4 .php3

To switch to PHP 7.3
AddHandler application/x-httpd-php73 .php .php5 .php4 .php3

To switch to PHP 7.2
AddHandler application/x-httpd-php72 .php .php5 .php4 .php3

To switch to PHP 7.1
AddHandler application/x-httpd-php71 .php .php5 .php4 .php3

To switch to PHP 7.0
AddHandler application/x-httpd-php70 .php .php5 .php4 .php3

To switch to PHP 5.6
AddHandler application/x-httpd-php56 .php .php5 .php4 .php3

This will change the PHP version for that site and all of its sub folders. 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 version.

Share This Article