Skip to main content

How do I change my PHP version?

Switch the PHP version of your website in cPanel or WHM, set a version for one domain, and fix a site that breaks after the change.

You can change the PHP version your website runs on yourself, from cPanel on Web Hosting, Reseller Hosting and WordPress Hosting plans, or from WHM on a Cloud or Dedicated server. The change takes effect immediately, and you can switch back at any time from the same screen.

Use a PHP version that is still supported by the PHP community, and that your website's plugins and theme support. For the versions WHC offers, see which versions of PHP do you support?

Before you start

  • Check what your website needs. If your site runs WordPress, open each plugin's page in your WordPress dashboard and note its minimum required PHP version and its last update date. A plugin that hasn't been updated in a long time is the most likely to break on a newer PHP version. Compatibility scanning tools can help, but treat their results as a guide, not a guarantee.

  • Back up your website. Switching PHP versions doesn't change your files, but a backup lets you recover if a plugin or theme update made afterwards goes wrong. See the Backups articles.

  • Pick the newest version your site supports, not simply the newest version. Plugins and themes sometimes take a while to support a new PHP release. If you're unsure, choose the release just before the newest one.

On Managed WordPress, you can test a change on a copy of your site first. See how to use Managed WordPress staging.

If you have Web Hosting, Reseller Hosting or WordPress Hosting

You change the PHP version in cPanel, with the Select PHP Version tool (also called the PHP Selector).

  1. Under Software, click Select PHP Version.

    The Select PHP Version icon in the Software section of cPanel
  2. The PHP Selector opens on the Account Global Settings tab. In the PHP version drop-down menu, select the version you want, then click Apply. The version marked (current) is the one your account uses now.

  3. Optional, for advanced users: the Extensions tab lists the PHP extensions (modules) available for that version. Tick or untick the ones you need. To go back to the extensions WHC recommends, click Reset PHP Extensions to default. PHP settings such as memory limits are on the Options tab.

Your website uses the new PHP version right away. To confirm it on a WordPress site, go to Tools > Site Health > Info in your WordPress dashboard and open the Server section.

This changes the PHP version for every website on your cPanel account. To give one website a different version, see the next section.

Avoid the Native version: it can change over time and doesn't offer the same settings. Older PHP versions remain safe to use at WHC thanks to HardenedPHP.

Use a different PHP version for one website

The PHP Selector sets one PHP version for every domain on your cPanel account. To give a single domain its own version, hand that domain over to cPanel's MultiPHP Manager, then choose its version there.

  1. In the PHP Selector, click the Per Domain Settings tab.

  2. Find the domain you want to change and click Use MultiPHP Manager in the Action column.

  3. Go back to the cPanel home page. Under Software, click MultiPHP Manager.

  4. Tick the box next to the domain, select the version you want in the PHP Version drop-down menu, and click Apply.

The Per Domain Settings tab may show a warning that site isolation has been denied. You can ignore it: you don't need isolation to change a domain's PHP version this way.

A domain handled by MultiPHP Manager no longer uses the extensions and options you set in the PHP Selector. To return the domain to your account-wide version, open the Per Domain Settings tab and click Use PHP Selector next to that domain.

If you have a Cloud or Dedicated server

You change the PHP version of each cPanel account in WHM, with the MultiPHP Manager. If your server runs CloudLinux, use the cPanel method above instead, from each cPanel account.

  1. Under Software, click MultiPHP Manager.

  2. Scroll down near the bottom and find the account or accounts you want to change.

  3. In the PHP Version column, select the version you want from the drop-down menu. The change takes effect immediately.

  4. Optional: turn on the PHP-FPM toggle to speed up PHP for that account.

If your website stops working after a change

The quickest fix is to switch back to the PHP version that worked, using the same steps. Your site recovers as soon as you do. Then find the cause:

  • Your site works on an older PHP version (for example 7.4) but breaks on PHP 8 or later. A plugin or theme isn't compatible with the newer version. Update it, or replace it if no update exists, then switch PHP again. See how to manually update WordPress and WordPress plugins.

  • Pages or a page builder such as Elementor stop loading after you update a plugin or theme. The update may need a newer PHP version than your site uses. Back up your site, change to a PHP version the update supports, and hold off on further plugin and theme updates until your site is stable.

  • The version you want isn't in the list. You can only choose the versions shown. A version that isn't listed isn't available on your server.

Did this answer your question?