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)
- Log in to cPanel from MdmHost dashboard → Services.
- Open cPanel → Software → Select PHP Version.
- Choose a version from the Current PHP version drop-down and click Set as current.
- Check the Extensions tab. WordPress needs at least
mysqli(ornd_mysqli),curl,gdorimagick,mbstring,xml,zip,intlandopcache. - 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_logandwp-content/debug.logfor 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
mysqliornd_mysqliin the Extensions tab. - Images no longer resize: enable
gdorimagick. - Fatal error mentioning
create_functionoreach(): an old plugin uses functions removed in PHP 8. Update or replace it. - Version change has no effect: an old
AddHandlerline in.htaccessforces a version. Remove lines starting withAddHandler 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.
