Changing the version of PHP used by your website Print

  • 0

What is PHP?

PHP is the programming language your website is most likely written in. It releases newer versions periodically, which have improved performance, more features, and more security (although our hosting platform applies security patches to even very old versions of PHP).

Changing the PHP version

You can change the version of PHP that your website runs on via cPanel by going to Select PHP Version , click the drop-down beside PHP version , choose the new version, then click Set as current.

How do I access cPanel?

You can access cPanel through two ways:

  1. If you if you know your cPanel username and password, you can access it directly via https://www.example.com/cpanel where 'example.com' is your website's domain name
  2. Or, you can also access it through our Client Area — click the hosting service for your domain name, then click login to cPanel on the left. (If you don't have your Client Area login details you can set a password here using the primary email address through which we communicate with you).

Which version of PHP should I run?

This depends on your website software.

If you have a WordPress website, then WordPress itself, plus any plugins and themes you have installed, will all need to be compatible with a particular version of PHP. Most of the time, they are compatible with the latest version of PHP, but some plugins don't get updated as quickly as others, so there is no guarantee.

We recommend trying the highest version of PHP, clearing your website's Page Cache if you have one, then seeing if everything appears to be working. There is also a plugin called the PHP Compatibility Checker which can help determine any issues. If it doesn't appear to work with the highest version, try the next one down, until you find one that is fully compatible.

Other considerations

  • When changing the PHP version, you should also check the Extensions and Options tabs, as those settings are tied to each version of PHP, and so may be different if they have been changed from the defaults.
  • Any errors resulting from a change in PHP version will usually be logged to your website's error log, which, by default, will be stored in the file public_html/error_log. Inspect that to find the root cause of a compatibility problem.
  • PHP 8 only supports the MySQL Native Driver extension (nd_mysql, nd_mysqli, nd_pdo_mysql), whereas many websites are configured to use the older driver (mysql, mysqli, pdo_mysql). If the PHP extension for MySQL is changed to the nd_* ones, you may find it necessary to perform a REPAIR TABLES operation on the database tables in phpMyAdmin, to force open database connections to reconnect using the new driver.

 


Was this answer helpful?

« Back