Skip to content
Errors after an update

A plugin needs a newer PHP version

WordPress warns about outdated PHP, or a plugin won't install. How to upgrade PHP without taking the site down.

You need
Hosting panel
Updated

Plugins can declare the PHP version they need in their Requires PHP field. If the server runs an older version, WordPress won't install, update or activate the plugin. Which PHP versions you can choose from is up to your hosting provider.

The fix is to upgrade PHP on the server. You do that in the hosting panel, not in WordPress. Most providers let you switch versions yourself, and switch back if something breaks.

Check which version you have

Go to Tools → Site Health, select the "Info" tab and expand "Server". The PHP version is listed there. WordPress recommends PHP 8.3 or newer. php.net shows which versions still get security fixes. If yours no longer does, upgrade regardless.

These are the messages you see when the version is too old:

  • When you try to install the plugin, the "Install Now" button is greyed out, with the text "This plugin does not work with your version of PHP."
  • Under Plugins, a new version is available, "but it does not work with your version of PHP".
  • The Dashboard shows a "PHP Update Required" or "PHP Update Recommended" box.

The PHP version a plugin requires is listed under "PHP version" in the sidebar of its page on wordpress.org.

Prepare the upgrade

A newer PHP version can break old plugins and themes. Do this first:

  1. Back up both the files and the database.
  2. Update WordPress, your plugins and your theme under Dashboard → Updates, and check that the site works.
  3. Delete plugins and themes you don't use, but keep one WordPress default theme. Unused plugins and themes can still contain vulnerabilities.
  4. If your hosting provider offers a staging environment, try the new PHP version there first.

Switch the PHP version in the hosting panel

  1. Log in to your hosting panel and find the PHP settings. In cPanel the tool is called MultiPHP Manager, and in Plesk you choose the version in the domain's PHP settings.
  2. Select the domain and a PHP version at least as new as the one the plugin requires.
  3. Save, then check the front page, wp-admin and the parts of the site that matter most, such as forms and payments.
  4. Open Tools → Site Health. If the new PHP version lacks modules that WordPress requires or recommends, such as imagick or intl, they're listed there. You enable modules in the PHP settings in the hosting panel.

If you can't find any PHP settings, your hosting provider has to switch the version for you.

If the site breaks after the switch

If you get a critical error or a white screen, switch PHP back to the old version in the hosting panel. The site works again immediately, as long as nothing else has changed in the meantime.

Then find out what failed. Turn on the error log: find the line define( 'WP_DEBUG', false ); in wp-config.php and replace it with these three lines:

define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );

If that line isn't there, add the three lines just above require_once ABSPATH . 'wp-settings.php';.

Switch to the new PHP version again, load the site and open wp-content/debug.log. The line with PHP Fatal error shows the file path of the plugin or theme that causes the error. Update or replace that plugin or theme, and try again. Set WP_DEBUG back to false and delete debug.log when you're done. Otherwise anyone can read the log in a browser.

When you're stuck

If your hosting provider doesn't offer a recent enough PHP version, you have to move the site to another provider. A plugin or theme you depend on may also fail on the new PHP version with no update available. Then you have to switch to another plugin or theme, or have the code fixed, which requires a developer who knows WordPress and PHP.