How can i change php version in shared hosting?

This article describes how to change the PHP version and additional PHP settings in cPanel.

Changing the PHP version

A2 Hosting servers support multiple versions of PHP. To change the PHP version used for your account, follow these steps:

  1. Log in to cPanel.

    If you do not know how to log in to your cPanel account, please see this article.

  2. Open the PHP Selector:
    • If you are using the Jupiter theme, on the Tools page, in the Software section, click Select PHP Version:

      How can i change php version in shared hosting?

    • If you are using the Paper Lantern theme, in the SOFTWARE section of the cPanel home page, click Select PHP Version:

      How can i change php version in shared hosting?

    If you do not see the Select PHP Version icon, your server does not support this feature. 

  3. cPanel displays the current PHP version. To change the PHP version, in the Current PHP Version list box, select the version that you want to use, and then click Set as current. The new PHP version takes effect immediately.

Changing PHP settings

In addition to changing the PHP version from cPanel, you can change various PHP settings. You can enable and disable PHP extensions, as well as configuration directives such as allow_url_fopen, error_log, and many more.

This feature removes the need to configure and maintain custom php.ini files. Instead, you control all PHP settings directly from cPanel.

To change your PHP settings, follow these steps:

  1. Log in to cPanel.

    If you do not know how to log in to your cPanel account, please see this article.

  2. Open the PHP Selector:
    • If you are using the Jupiter theme, on the Tools page, in the Software section, click Select PHP Version:

      How can i change php version in shared hosting?

    • If you are using the Paper Lantern theme, in the SOFTWARE section of the cPanel home page, click Select PHP Version:

      How can i change php version in shared hosting?

    If you do not see the Select PHP Version icon, your server does not support this feature. 

  3. On the Extensions tab, select which extensions you want to enable for the current PHP version:

    • To enable an extension, select the check box next to the extension name.
    • To disable an extension, clear the check box next to the extension name.

      How can i change php version in shared hosting?

    • Selections are saved automatically.

    To reset the extension list to the default configuration, click Reset to default in the top right corner.

  4. To change settings for the current PHP version:

    • Near the top of the page, click the Options tab.
    • Click the value next to the setting that you want to modify.
    • Depending on the type of setting, a list box may appear with predefined settings that you can choose. Or, a text box may appear so you can type the value:

      How can i change php version in shared hosting?

    • Changes are saved automatically, and take effect immediately.

    When you modify a setting, a Reset to default link appears beneath the setting label. Click the link to change the setting back to the default value.

Overview

At this time, the Grid offers multiple versions of PHP, in the form of PHP-Stable, PHP-Latest, and FastCGI). PHP 5.6 and PHP 7 are available on all Media Temple Grid accounts. For more information about PHP 7, navigate here.

You may change or see your PHP version for each domain in the AccountCenter at any time.

  1. Log into your AccountCenter.
  2. From the Overview page or Domains tab, select your primary domain.
  3. This opens your Grid Control Panel. Click on PHP Settings.

    How can i change php version in shared hosting?

  4. On the next screen, you will see the versions of PHP that are currently available. Here you will make your selection(s). You may do so on a per-domain basis or for all of your domains at once.
    How can i change php version in shared hosting?
  5. Select the desired PHP version for each domain; you can choose between PHP-Stable (5.3.23) and PHP-Latest (7.0).
  6. You may also click on the PHP version (for example, the "PHP Stable (5.3.23)" link) to bring up a "phpinfo.php" page. This page contains more details on how PHP has been set up on this platform.
    How can i change php version in shared hosting?

Resources

  • How do I enable FastCGI?
  • The authoritative source for PHP information is at http://www.php.net

Overview

This article shows you how to update PHP to a different version. The latest version is PHP 7, which includes many upgrades to speed and stability. For more information about PHP 7, navigate here.

Before Proceeding! Make sure that you have a recent backup of all data on the server that you will be making changes to.

Plesk

These instructions will show you how to use the Plesk admin panel to change PHP versions. Start by logging into Plesk.

1. Log into the Plesk admin panel and select Tools & Settings from the options on the left.

How can i change php version in shared hosting?

2. Select Updates and Upgrades from the Plesk column.

How can i change php version in shared hosting?

3. Select Add/Remove Components

How can i change php version in shared hosting?

4. Use the + next to Web hosting to expand the column, then do the same for PHP interpreter versions. Change your desired version to install and click continue.

How can i change php version in shared hosting?

The Plesk installer will run. Once complete, you will be able to use your chosen PHP version.

Note: You do not necessarily need to remove previous versions of PHP. Doing so may cause conflict with various native Plesk applications such as Horde.

5. After installing your desired PHP version, you will need to update the PHP Settings of your domain. Click on Domains (note: for some Plesk versions this may be called Websites & Domains).

How can i change php version in shared hosting?

6. A list of domains will appear. Select your desired domain.

How can i change php version in shared hosting?

7. Once at your domain's control panel, click on PHP Settings.

How can i change php version in shared hosting?

8. In your PHP Settings, click on the current PHP version. A list of available PHP versions will appear. Select your desired version, then scroll to the bottom of the page to select Apply.

How can i change php version in shared hosting?

How can i change php version in shared hosting?

cPanel

These instructions will show you how to use the cPanel WHM utility to change PHP versions.

You may need to install your desired version of PHP before you may use it. PHP version installation is handled through the EasyApache template configuration tool. If you know that you already have the version of PHP that you require, skip the EasyApache PHP installation instructions.

Note: Only one version of EasyApache may be active at a time. cPanel supports PHP 7 via EasyApache 4 only. You must use EasyApache 4 if you plan to use PHP 7 with your cPanel install.

Instructions for EasyApache 3

1. Log into WHM and select the Software panel. 

How can i change php version in shared hosting?

2. Select EasyApache 3. If EasyApache 4 is active, you'll receive an error letting you know that another version is currently active and you will need to either revert back to EasyApache 3 or select EasyApache 4. Only servers that were originally provisioned with EasyApache 3 may revert back to it.

How can i change php version in shared hosting?

3. You should now see a list of available Apache profiles. From here it is easy to manage various aspects of your Apache build. To change your PHP version, select the edit tool to the right of your default profile.

How can i change php version in shared hosting?

4. Select Next Step to move to the PHP version menu. Select the version that you'd like to install and proceed through the remaining menus.

How can i change php version in shared hosting?

Important: It is very important to allow the EasyApache build process to complete. A premature termination will very likely result in a total failure of cPanel, and you will have to restore from a backup.

Instructions for EasyApache 4 

1. If you haven't installed EasyApache 4, connect to your server via SSH and execute the following:

/scripts/migrate_ea3_to_ea4 --run
  • Confirm the installation using 'y'. This process make take several minutes to complete.

2 . Once EasyApache 4 installation is complete, log into WHM and select the Software panel.

How can i change php version in shared hosting?

3.  Select EasyApache 4 from the software list. 

How can i change php version in shared hosting?

4.  Click the Customize button to the right of Currently Installed Packages. If you would also like to change your package, select one from the list and use the Customize option. Please be aware that changing these settings may impact the performance of your cPanel installation.

How can i change php version in shared hosting?

5. From the menu on the left, click on PHP Versions. Select the version(s) of PHP that you'd like to install and click Next.

How can i change php version in shared hosting?

6. You'll now be asked to select PHP extension packages. If you are unsure of which ones you need, use the default selected packages for your PHP version. Click Next.

7. The review section will now give you an overview of everything that you've changed before provisioning. If you're ok with the changes to your system, click Provision. Depending on the changes you made, this process may take a few minutes to complete. Once you've received a confirmation that the configuration has been successfully provisioned, click Done.

Important: It is very important to allow the EasyApache build process to complete. A premature termination will very likely result in a total failure of cPanel, and you will have to restore from a backup.

Use the cPanel MultiPHP Manager to change PHP versions (EasyApache 4)

cPanel allows for PHP versions to be changed within both WHM and individual cPanel user accounts. This feature is only available when using EasyApache 4.

For all cPanel user accounts

1. To change the PHP version for cPanel accounts, log into WHM and click on the Software panel. You may also use these instructions from within individual cPanel accounts, but you will not be able to change the PHP version for domains that are not assigned to that account.

How can i change php version in shared hosting?

2.  Click on MultiPHP Manager. This will open a new menu which allows you to set both the system default PHP version, and control PHP versions on a per-domain basis.

  • WHM only: To change the default version of PHP that all cPanel servers are provisioned with, select a version under System PHP Version and click Apply.

How can i change php version in shared hosting?

  • WHM/cPanel: To change PHP versions on a per domain basis, select the domain you'd like to change and use the dropdown menu on the right to determine the PHP version, then click Apply.

How can i change php version in shared hosting?

3. You should now be using your assigned version of PHP. Verify that your version is correct and working properly by creating a PHP info page. If you need help, instructions can be found in this article.

Resources

Connect via SSH
Install EasyApache 4

How do I change my PHP version to host?

Change the PHP Version on Your Sites.
Login to cPanel..
Click the MultiPHP Manager link in the Software section of cPanel..
Check the box for the site or sites you wish to update..
Select the desired PHP Version from the drop-down menu..
Click the Apply button..

How do I switch between PHP versions?

In the account Dashboard, in the Settings section, select Server. The current PHP version appears at the top of the list. To change the PHP version, next to PHP version click Change. Select another PHP version from the list and then enter update in the Type 'update' to confirm field.

How do I edit PHP INI on shared hosting?

How to edit php..
Log into your cPanel account, go to the Files section >> the File Manager menu. ... .
Navigate to the root directory of the domain, click on New File, and create a file named php. ... .
Find the newly created file in the list, right-click, and choose Edit:.

How do I update my PHP Server live?

Curious as to what PHP version your website is using?.
Log in to cPanel..
Select MultiPHP Manager in the Software section..
Select the domain you want to upgrade by checking the box on its left side..
Choose 7.4 or select the newest PHP version from the dropdown, then click Apply..