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.5, PHP 5.6, PHP 7.0 and PHP 7.1.

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 sub-directories for it as well)
  4. Click on the directory name
  5. Select the desired PHP version and click Save

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.2

To switch to PHP 7.1

To switch to PHP 7.0

To switch to PHP 5.6

To switch to PHP 5.5

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.

You find this article useful? Click here to learn more about SiteGround web hosting experts and what else we can do for you!