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

It is really easy to change PHP versions for your website with a web hosting account with SiteGround. All you need to do is follow those step:

  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

That is all.

You can find detailed instructions how to manually change the PHP version for your account below:

Go to cPanel, File Manager and choose "Web Root (public_html/www)". There create a new file (or edit the existing one) called .htaccess and add the following line:

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 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 version in it.

If you want to be able to use different PHP versions on a per-folder basis, you can sign up for a hosting account at SiteGround. We offer the best PHP hosting and our support team is ready to assist you with any PHP questions/problems you may have.


  1. Reply November 14, 2015 / 03:42 JehzeelSiteGround Team

    This is awesome! I don't think other hosting providers have this feature! NIceeeeeeeee! 😀

  2. Reply May 28, 2016 / 17:01 Courtney TuckerSiteGround Team

    I have my php version set to 7.0.6. Magento 2 can't seem to detect the php version I'm using. What can be done to resolve this issue?

    • Reply May 30, 2016 / 06:19 Hristo PandjarovSiteGround Team

      Please, post a ticket in your Help Desk and my colleagues from the support team will check the issue.

    • Reply August 26, 2016 / 21:03 MaartenSiteGround Team

      For anyone running into the same issue, I was helped by the helpdesk, and this worked for me:

      So the reason why the version is showing differently is because the -v command is checking the cli version, instead of the magneto one. Because of that, the path to the php binary needs to defined in order for the version to acknowledged properly. The command that needs to be executed in that case is - /usr/local/php70/bin/php-cli /home/[youraccountname]/public_html/ ...the name of the script that needs to be executed/

  3. Reply December 10, 2016 / 23:48 Daniel FehrmannSiteGround Team

    I was receiving an error because the PHP version my page was using was to old...I was set up to get on the waiting list for a support call tonight and then i thought why not check the knowledge base... oh boy was that a good movie.. I'm thoroughly impressed with how well Siteground keeps their documentation. Thanks a lot guys!!

    • Reply December 20, 2016 / 13:06 Hristo PandjarovSiteGround Team

      Thanks for the kind words!

  4. Reply January 26, 2017 / 23:22 DeniseSiteGround Team

    I'm looking for a php4 hosting partner. Does this article imply that PHP4 is not supported anymore hence the article below is outdated?

    • Reply February 1, 2017 / 15:45 Ivan AtanasovSiteGround Team

      Support for PHP 4 has been officially discontinued since 2007-12-31 (PHP releases). This version is very outdated and is no longer recommended on any hosting platform due to the high security risk it represents for your website. It is why it was removed from the PHP Manager tool.

      For now, you can still assign it to your website by using this guide

* (Required)