Last updated:

cPanel has a MultiPHP feature that lets you choose which PHP version you want to use for individual domains. Different addon domains and subdomains can have different PHP versions.

The interface

You can manage what version of PHP is used for a domain via Software » MultiPHP Manager.

The MultiPHP interface in cPanel. In the image, the system version is set to PHP 7.2. It also shows that two domains use that PHP version.
cPanel’s MultiPHP manager.

At the top of the page you see the system PHP version. This is the system’s default PHP version; it is used when a new cPanel account is created. The default PHP version is also known as the inherited version. In the above image the default PHP version is 7.2.

Your domain(s) may or may not use the inherited version. The table at the bottom of the page list all domains on your cPanel account, together with the PHP version. There are two domains in the above image: example.com and foo.bar. Both domains use the inherited PHP version.

How to change a PHP version

As at January 2024, the latest and greatest PHP version available on the server is 8.1. You can switch to that version as follows:

  • Select the domain(s) for which you want to change the PHP version. In the below example I have selected example.com.
  • Pick the PHP version you want to use for the domain(s) from the PHP Version drop-down list.
  • Click the Apply button.
You can change the PHP version for a domain by selecting it and then selecting the new PHP version from the PHP Version drop-down menu.
Updating the PHP version for example.com to PHP 8.1.

Scary warnings

It is fairly likely you get a warning when you change the PHP version for a domain. These warnings are difficult to comprehend and they look rather scary, but in most cases they can be safely ignored.

Changing away from the default PHP version

One of the most common warnings is related to the the system PHP version, which is also known as the default or inherited PHP version. If your website uses the system PHP version then cPanel warns you that you won’t be able to switch back to the “previous version”. You can safely ignore that warning. What it tells you is that you can’t select the inherited version from the PHP Version drop-down list. However, you can still pick the exact same PHP version from the drop-down list! For instance, if the system version is PHP 7.2 then you can simply select PHP 7.2 from the drop-down list.

Strictly speaking, this are two different PHP versions, in the sense that the second PHP 7.2 version isn’t linked to the default PHP version. If we would change the system’s default version then the PHP version for your domain would still be PHP 7.2. However, in most cases that is a feature rather than a bug; it means that your website’s PHP version won’t suddenly change without you knowing.

Changing the PHP version for your main domain affects addon domains

If you change the PHP version for your primary domain then the PHP version of any addon domains might change as well. For instance, the warning in the above image shows that changing the PHP version for example.com will also change the PHP version for foo.bar (even though I didn’t select foo.bar). Unfortunately, there is no way to prevent that. However, there is a work-around: you can apply the change and then change the PHP version of any addon domains back to what they were.

Changing the PHP version for addon domains affects subdomains

Another common warning is related to addon domains. In the above image, the domain foo.bar is an addon domain. In the background, an addon domain is actually a subdomain with an alias. cPanel does a good job of hiding that complexity, but when you change the PHP version for an addon domain you suddenly get a warning telling you that changing the PHP version of your addon domain will also change the PHP version of a weird-looking subdomain. In the case of my foo.bar website, cPanel warns me that it will also change the PHP version for foo.bar.example.com. As the weird-looking subdomain is only used in the background you can ignore this warning.

Always check your website

As said, changing the PHP version for a domain can break things. In general, you are likely to run into issues if your website’s PHP code is very old. For instance, if your website uses the mysql_connect function to connect to a database then your website will break if you switch to PHP 7 or 8 (the function has been removed in favour of mysqli_connect). In that case you need to update your code before you change the PHP version.

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.

More about the system version

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 system version. That is likely to break websites, in particular if the inherited version is very old.

This is in fact a good reason to not use the inherited PHP version for your domains. By not using the inherited version you take control of what version your website uses. The only downside is that you will need to manually update the PHP version from time-to-time.