WordPress

Choose and change the PHP version for WordPress

Pick a supported PHP version for WordPress, check plugin and theme compatibility, switch versions in cPanel with Select PHP Version or MultiPHP and roll back if needed.

IntermediatecPanel hosting3 min read

PHP is the language WordPress runs on, and each PHP version is supported with security fixes for a limited time. Newer versions are faster and safer, but very old plugins and themes may not run on them. This guide shows how to pick a version and switch without surprises.

Before you start

  • Find the current version in WordPress → Tools → Site Health → Info → Server.
  • Check WordPress's own recommendation in Tools → Site Health → Status; it warns when your PHP version is outdated.
  • Take a backup, or better, test on a staging copy first.

Which version should I use?

Use the newest PHP version that all your plugins and your theme support. Current WordPress releases run on modern PHP 8.x versions. Avoid any version that no longer receives security updates from the PHP project, even if your site still works on it. When in doubt, choose the version one step below the very newest release, which has had time for plugins to catch up.

Check compatibility first

  • On each plugin's page at wordpress.org look at Tested up to and Requires PHP, and the date of the last update. A plugin not updated for two years is a risk on any new PHP version.
  • Ask premium theme and plugin vendors which PHP versions they support.
  • Run the site on staging with the new version and watch the debug log for Deprecated and Fatal error messages.

Switch with Select PHP Version (CloudLinux)

  1. Log in to cPanel from MdmHost dashboard → Services.
  2. Open cPanel → Software → Select PHP Version.
  3. Choose a version from the Current PHP version drop-down and click Set as current.
  4. Check the Extensions tab. WordPress needs at least mysqli (or nd_mysqli), curl, gd or imagick, mbstring, xml, zip, intl and opcache.
  5. Re-check your limits on the Options tab, because each version has its own settings.

Switch with MultiPHP Manager

If Select PHP Version shows that the domain is managed by MultiPHP, use cPanel → Software → MultiPHP Manager instead: tick the domain, choose the version in the PHP Version drop-down at the top and click Apply. MultiPHP can set a different version per domain, which is handy when one old site cannot be upgraded yet.

Test after switching

  • Load the home page, a post, a page with a form and the dashboard.
  • For shops, complete a test order.
  • Look in error_log and wp-content/debug.log for new errors.
  • Purge LiteSpeed Cache so you are not testing cached pages.

Roll back

If something breaks, switch back to the previous version in the same screen. The change is instant and does not touch your files or database. Then fix or replace the incompatible plugin before trying again.

Troubleshooting

  • "Your PHP installation appears to be missing the MySQL extension": enable mysqli or nd_mysqli in the Extensions tab.
  • Images no longer resize: enable gd or imagick.
  • Fatal error mentioning create_function or each(): an old plugin uses functions removed in PHP 8. Update or replace it.
  • Version change has no effect: an old AddHandler line in .htaccess forces a version. Remove lines starting with AddHandler application/x-httpd- that you did not add on purpose.

Frequently asked questions

Does the PHP version affect speed?

Yes. Each PHP 8.x release brought performance improvements, and combined with OPcache and LiteSpeed Cache a current version noticeably reduces page generation time.

Does WP-CLI use the same version?

Not always. The command-line PHP can differ from the web version; check with php -v.

Next steps

Was this guide helpful?

Still stuck?

Ask MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.