1. Knowledge Base
  2. >
  3. Results
  4. >
  5. How Do I Update the PHP Version on my Site?

How Do I Update the PHP Version on my Site?

 

Suppose you ever encounter problems with the way your server handles PHP packages or find WordPress requesting that you upgrade your PHP version. In that case, it is helpful to know how to view and modify your server's PHP. Updating your site's PHP version is vital for the security of your website. Whenever a new PHP version is released, the latest security patches will be implemented. This article discusses a few options on how to upgrade the PHP version in your hosting account.

What You Should Know
  • HostGator will be removing PHP 5.2 and 5.3 on Shared and Reseller hosting plans starting on August 31, 2021. With this soon-to-be update, you need to update your installations and applications so your websites can work with higher PHP versions before the removal of PHP 5.2 and 5.3.
     
  • Starting February 2021, HostGator will upgrade the available PHP versions on our hosting servers. PHP 7.4 will be available on shared hosting.

    Please be aware that PHP versions older than 7.3 will no longer be supported as we work on upgrading accounts. If it is necessary for your website to use the older PHP versions, this can be done manually. Let us know via phone or Live Chat so we can assist you. However, we highly recommend that you upgrade all your website installations and applications to be compatible with the newest PHP version.

How Do I Upgrade My Site's PHP Version?

If your website needs a different PHP version, you will want to log into your cPanel to manage the site's version.

Important Note:
For our Optimized WordPress customers, put your mind at ease! HostGator's got your back in ensuring that your account is running the latest up-to-date PHP version.
  • There is no need to downgrade PHP for a WordPress plugin or theme. Instead, it is best to upgrade your plugin or theme to work with the PHP version available in your Optimized WordPress accounts.
  • If you need to change your PHP version, our support team will handle that for you. Just reach out to us via phone or Live Chat.

MultiPHP Manager or PHP Selector

Depending on the version of cPanel you're using, you will use either MultiPHP Manager or PHP Selector to modify your PHP version. PHP Selector is being phased out, so it is most likely that you will use MultiPHP Manager. To determine which one you have, you will need to:

  1. Log in to cPanel
  2. Navigate to the Software section.

    cPanel Left-Hand Menu - Software


Option 1 - MultiPHP Manager


Here are the instructions outlined in the video above.

Curious as to what PHP version your website is using? A phpinfo file is what you need. To find out how to create a phpinfo file, please visit this article, How to create a phpinfo.php file.
  1. Log in to cPanel.
  2. Select MultiPHP Manager in the Software section.

    HostGator cPanel MultiPHP Manager

  3. Select the domain you want to upgrade by checking the box on its left side.

    MultiPHP Manager Select Domain

  4. Choose your preferred PHP version from the dropdown, then click Apply.

    MultiPHP Manager Select PHP Version

  5. There will be a pop-up in the upper right corner, notifying you that the change was successful.

    PHP Version Change Successful

If you previously used the PHP Selector to change your PHP version, there may be a handler in your .htaccess file that needs to be removed similar to this one:

Use PHPedge as default
AddHandler application/x-httpd-php-edge .php
<IfModule mod_suphp.c>
    suPHP_ConfigPath /opt/phpedge/lib
</IfModule> 

For specific instructions on how to fix "Missing MySQL Extension" errors, please refer to our support article How to Fix Error After MultiPHP upgrade.


Option 2 - PHP Selector
This will be sunset, and few will have it available.

The PHP Selector can be seen in some Shared servers. However, it may be time to say goodbye to this feature very soon as you may not see the PHP Selector available in your cPanel anymore. If you do still happen to have the PHP Selector, click the expand below for the instructions.

The PHP Selector allows users on Shared and Reseller servers to easily enable a specific PHP version for a site.

To upgrade the PHP version of a site using the PHP Selector, please watch this video.


Here are the instructions outlined in the video above.

Want to know your website's PHP version? Please visit the article How to create a phpinfo.php file.
  1. Log into cPanel.
  2. In the Software section, click the PHP Selector icon.
    cPanel PHP Selector Plugin
  3. Navigate to the directory of the website you wish to upgrade the PHP. The document root for the primary site on your account is the public_html folder.
    cPanel PHP Configuration
  4. From the dropdown menu, select the version of PHP you want to use, then click upgrade.
    cPanel Select PHP Version
    Caution: If your site's scripts rely on PHP's older functions, which are no longer available in the latest stable version being used on the server, you may encounter compatibility issues when the PHP is automatically upgraded.

When using PHP Selector, upgrades are applied recursively. This means any upgrade you apply to a directory will also apply to all subdirectories unless you apply a different directive to one of those subdirectories. Therefore, to use a different PHP version for an addon domain, you would need to navigate the document root for the addon domain and select the appropriate PHP version.

Need a bit more help? Contact HostGator support via phone or Live Chat, and we will be happy to assist you!