Knowledge Base

How to change PHP versions and settings in cPanel

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

The information in this article only applies to certain types of hosting accounts. To determine whether or not the information below applies to your account, please see this article.

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. In the Software/Services section of the cPanel home screen, click Select PHP Version:

    cPanel - Select PHPVersion icon

    If you only see PHP Version (not Select PHP Version) in the Software/Services section, your server does not support this feature. Please see the note at the top of this article for more information.
  3. cPanel displays the current PHP version. To change the PHP version, in the PHP Version list box, select the version that you want to use, and then click Set as current:

    cPanel - Select PHP Version list box

  4. 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. In the Software/Services section of the cPanel home screen, click Select PHP Version:

    cPanel - Select PHPVersion icon

    If you only see PHP Version (not Select PHP Version) in the Software/Services section, your server does not support this feature. Please see the note at the top of this article for more information.
  3. 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.
    • Click Save to save the extension settings.
    To reset the extension list to the default configuration, click Use Defaults.
  4. To change settings for the current PHP version:

    • Click Switch to PHP Settings.
    • 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.
    • Click Apply, and then click Save to save the settings.
    When you modify a setting, the value turns yellow to indicate that it has been changed. When you save a modified setting, it turns green to indicate that the value is different from the default value. If you reset a setting to its default value, the color returns to gray.
  5. The new PHP settings take effect immediately.