On cPanel servers you can select which PHP version you want to use for an individual domain. Different addon domains and subdomains can have different PHP versions.
You can manage what version of PHP is used for a domain via Software » MultiPHP Manager.
Image: cPanel’s MultiPHP Manager.
At the top of the page you see the system PHP version. This is the default PHP version used on the server; it is used when a new cPanel account is created. The default PHP version is also known as the inherited version.
At the bottom of the page is a list with all domains on your cPanel account. In the above screenshot the PHP version for the domain example.com is 7.2, and you can also see that this version is “inherited”.
As at March 2021 the newest PHP version on the server is 7.4. To switch to that version you can select the domain and then select PHP 7.4 (ea-php74) from the PHP Version drop-down menu. Clicking Apply instantly changes the PHP version.
You are likely to see two warnings on the MultiPHP Manager page. The first warning is about deprecated PHP versions. As at March 2021 all PHP versions below 7.3 are no longer supported. Using old versions of PHP is strongly discouraged. These versions no longer get security updates. If your website uses PHP then you want to make sure that the PHP version is up to date – it makes your website more secure.
The second warning you might see is about not being able to switch back to a previous PHP version. You can safely ignore that warning. If you need to change the PHP version back then you can always pick another version from the PHP Version drop-down menu – there are typically four or five different versions available.
The PHP Version drop-down menu is likely to show only ea-php versions. On some servers you might also see a couple of alt-php versions. The ea-php versions are shipped by cPanel and the alt-php versions are provided by CloudLinux (which is the operating system we run on most of our shared servers). They are quite different and you can’t easily switch between the two.
If you see both versions in the drop-down list, check if the system version is an ea-php or alt-php version. If the system version uses alt-php then you can change the PHP version for your domain(s) via Software » Select PHP Version instead. And, if it’s an ea-php version then you need to make sure that you switch to another ea-php version. Your website will break if you switch from an ea-php to an alt-php version (though you can always switch back).
As said, changing the PHP version for a domain can break things. This is particularly true when you upgrade from PHP 5 to PHP 7. There are major changes between these versions, so you should only upgrade if your PHP code is compatible with the latest PHP version.
In general, you are likely to run into issues if your PHP code is very old. For instance, if your website uses the
mysql_connect function to connect to a database then you can’t use PHP 7 (the function was removed in favour of
mysqli_connect). In that case you need to update your code.
PHP upgrades are unlikely to be an issue if you use a content management system such as WordPress. As long as the WordPress core files, plugins and themes are up to date you should be fine. That said, you should always check your website after you change the PHP version. If you notice any issues then you can check the error logs for more information about the error. We are happy to help with that if needed.
If you are missing a PHP version in the drop-down menu, we can usually install the version. Please contact us if the version you want to use isn’t available on your server yet.
You might be wondering why the system version isn’t the latest and greatest PHP version. The reason is that the system version is inherited. If we change the default version then we change the PHP version for all domains using the inherited version. That is likely to break websites, in particular if the inherited version is PHP 5.6.
This is in fact a good reason for not using the inherited PHP version for your domains. By not using the inherited version you take control of what version is used by your website. The only downside is that you will need to manually update the PHP version from time-to-time.