Skip to content

How to update the PHP version of a WordPress site

The PHP version is changed in your hosting account, not in WordPress. Update WordPress, the plugins and the theme first, try the new version on a staging copy with the debug log on, then switch at the host and check the site. The same menu sets the version back.

By
WP Ministry
Published
Tested on
WordPress 7.1.3, PHP 8.3.35

In short

  • The PHP version belongs to the hosting account. The dashboard, a plugin and wp-config.php cannot change it.
  • Tools, Site Health, Info, Server shows the version the website runs. WP-CLI shows the command line's, which can be another one.
  • WordPress's notice about PHP repeats an answer from WordPress.org, and that answer can lag behind php.net. No notice is not proof.
  • A plugin's "Requires PHP" line is a minimum. Nothing declares whether a plugin runs on a newer PHP, so try it on a staging copy.
  • Extensions and settings belong to each PHP version. After the switch, look at Site Health for missing modules.
  • If a page breaks, set the version back at the host, then read the fatal line for the name of the plugin.

PHP is the language WordPress, its plugins and its theme are written in, and the server runs one version of it for your site. That version belongs to the hosting account. You change it in the hosting control panel, or the host changes it for you. Nothing inside WordPress can.

As of October 10, 2026, WordPress 7.1 is listed as compatible with every PHP version php.net still supports. The risk in a move is old code in a plugin or a theme, and an extension the new version was never given. So do the work in this order: see what the site runs now, bring everything up to date, try the new version on a copy, switch, check the site, and know the way back before you need it.

See which PHP version the site runs

  1. Step 1: In the dashboard

    Go to Tools, then Site Health, and open the Info tab. Open the section named Server. The row "PHP version" gives the number, followed by a note such as "(Supports 64bit values)". The row under it, "PHP SAPI", says how the web server starts PHP.

  2. Step 2: With WP-CLI

    Over SSH, from the folder WordPress is installed in:

    Read the lines "PHP binary" and "PHP version".

    bash
    wp --info
text
PHP binary:	/usr/local/bin/php
PHP version:	8.3.35

If the dashboard cannot be reached, the check file in how to fix "Your PHP installation appears to be missing the MySQL extension" prints the website's PHP version without WordPress.

What WordPress tells you about your PHP version

WordPress asks WordPress.org about the PHP version it finds itself on, and repeats the answer in two places.

On the Dashboard, an administrator sees a box headed "PHP Update Recommended" or "PHP Update Required". It opens with one of these sentences, with the site's own version in the brackets:

HeadingWhat it says
PHP Update Recommended"Your site is running on an outdated version of PHP (8.0.30), which does not receive security updates. It should be updated."
PHP Update Required"Your site is running on an outdated version of PHP (7.4.33), which does not receive security updates and soon will not be supported by WordPress. Ensure that PHP is updated on your server as soon as possible. Otherwise you will not be able to upgrade WordPress."

Each has a shorter form that leaves out the words about security updates, for a version that still receives them. The box ends with a button, "Learn more about updating PHP".

Under Tools, Site Health, on the Status tab, one result is about PHP:

ResultWhere it is listed
"Your site is running a recommended version of PHP (8.3.35)"Passed tests
"Your site is running on an older version of PHP (8.2.34), which should be updated"Recommended improvements
"Your site is running on an outdated version of PHP (8.0.30), which does not receive security updates. It should be updated."Critical issues
"Your site is running on an outdated version of PHP (7.4.33), which does not receive security updates and soon will not be supported by WordPress."Critical issues
"Unable to determine the status of the current PHP version (8.3.35)"Recommended improvements. The site could not reach WordPress.org to ask.

Each version in the two tables is one that draws that sentence on WordPress 7.1, going by what WordPress.org answered about it on October 10, 2026.

Where the thresholds come from

Almost all of it is WordPress.org's answer, not a figure in WordPress's code. WordPress sends its PHP version to api.wordpress.org/core/serve-happy/1.0/ and keeps the answer for a week. The answer holds a recommended version, a minimum version, and three yes-or-no answers: whether the version is still actively supported, whether it still receives security updates, and whether it is acceptable. The box on the Dashboard appears when "acceptable" is no.

One figure is in the code. WordPress 7.1 counts any PHP lower than 8.0 as below the minimum a future WordPress will need. For those versions it shows "PHP Update Required" whatever WordPress.org answers.

On October 10, 2026, WordPress.org answered with a recommended version of 8.3 and a minimum of 7.4. Its requirements page said the same that day. It recommends "PHP version 8.3 or greater", and says WordPress "also works with PHP 7.4+", with a warning that these older versions "have reached their official End Of Life and may expose your site to security vulnerabilities".

An old PHP also holds updates back. On the Updates screen, a WordPress release that needs a newer PHP shows a sentence that begins "You cannot update because" and names the PHP version it requires. Under a plugin on the Plugins screen, the line begins "There is a new version of", names the plugin, and goes on "available, but it does not work with your version of PHP."

Which PHP versions still get fixes

php.net supports each PHP branch for four years. For two years from its first stable release a branch is fully supported: faults and security issues are fixed. For two more it gets fixes for critical security issues only. Then it is end of life.

As its Supported Versions page read on October 10, 2026:

  • PHP 8.4 and 8.5 are in active support.
  • PHP 8.2 and 8.3 get security fixes only, and 8.2's end on December 31, 2026.
  • PHP 8.1 and every older branch is end of life.

Those dates move on every year. The WordPress and PHP end-of-life checker lists the PHP versions with both of their dates, read from php.net twice a day, and says where the version you choose stands today.

Which version to move to

Choose a version that passes four tests.

  • php.net still supports it, and preferably for years to come, so that you are not doing this again in a few months.
  • It is at least the version WordPress recommends, which was 8.3 on the day above.
  • Your WordPress runs on it. WordPress's compatibility table lists PHP 7.4 to 8.5 for WordPress 7.0 and 7.1, and stops at PHP 8.4 for WordPress 6.7 and 6.8. If the site is behind, update WordPress before PHP.
  • Your host offers it.

That table is about WordPress alone. It says the core software "is tested and compatible with the versions in this list", and notes that WordPress is rarely used without a theme or plugins. Those are what the next section is for.

Before you switch

  1. Step 1: Take a backup, and keep it off the server

    Back up the files and the database. How to schedule automatic WordPress backups covers where to keep the copy and how to prove that it restores.

  2. Step 2: Update WordPress, the plugins and the theme

    A plugin's newest release is the one its author has had the chance to make ready for a newer PHP. How to safely update WordPress, plugins and themes gives the order: one at a time, with a look at the site after each.

  3. Step 3: Read what each plugin and the theme declares

    A plugin can state the lowest PHP it supports on a "Requires PHP" line at the top of its main file, and a theme on the same line in style.css. WordPress.org shows it on a plugin's page as "PHP version", and the "View details" link on the Plugins screen shows it as "Requires PHP Version:". The commands under these steps list it for everything installed.

  4. Step 4: Make a staging copy and switch PHP there first

    A staging site is a private copy of the site at its own address. How to set up a WordPress staging site shows three ways to get one. Make sure the copy can run a different PHP version from the live site. Where the panel sets the version for each domain, a copy on its own subdomain can.

  5. Step 5: Turn the debug log on, on the copy

    With the log on, PHP writes down every error and every deprecation while you click through the copy. The lines are under these steps.

  6. Step 6: Write down the PHP settings you have now

    In Site Health, on the Info tab, the Server section also shows "PHP memory limit", "PHP time limit", "PHP max input variables", "Upload max filesize" and "PHP post max size". Settings like these can belong to a PHP version, so the new version may start from the host's defaults. "Copy site info to clipboard" at the top of the tab saves the whole list.

  7. Step 7: Check that the old version stays available

    Look at the list of versions in the hosting panel, or ask the host: after the switch, can you set the site back to the version it runs now, and until what date? If the host has told you a version is being retired, do the trial before that date, while going back is still possible.

The two commands list each plugin's and each theme's "Requires PHP":

bash
wp plugin list --fields=name,status,version,update,requires_php
wp theme list --fields=name,status,version,update,requires_php

Read the result for what it can tell you, which is less than it seems.

  • "Requires PHP" is a minimum. WordPress checks only that the server's PHP is at or above it. No header says how new a PHP the code runs on, so a plugin that declares 5.6 can still stop on 8.3.
  • An empty value means the author declared nothing. Together with a plugin that has not been updated in years, that marks the ones to watch on the staging copy.
  • unavailable in the update column means a newer release exists and needs a higher PHP than the one WP-CLI is running on. When an update is waiting and WordPress.org says what it needs, the requires_php column shows that, not what the installed release declares.

WordPress.org's own page on updating PHP still suggests a plugin named PHP Compatibility Checker for this step. That plugin's listing says it "is no longer actively maintained", that it checks compatibility "up to PHP 8.0", and that it "cannot detect runtime compatibility issues" because it does not run your code. Do not count on a scan. Run the site on the new version, on the copy, and read what PHP says.

Turn the debug log on

In wp-config.php, replace the line define( 'WP_DEBUG', false ); with these three, above the line that says "stop editing". They write every message to wp-content/debug.log and keep it off the pages.

wp-config.php
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );

With WP-CLI:

bash
wp config set WP_DEBUG true --raw
wp config set WP_DEBUG_LOG true --raw
wp config set WP_DEBUG_DISPLAY false --raw

How to turn on WordPress debug mode explains each line, and how to keep the log out of public view on a live site.

Switch the version at your host

The switch is made in the hosting account. WordPress.org says so on its page about updating PHP: "PHP is installed on your website's server, so updating it involves either interacting with your host's settings or asking your provider to do it for you."

In most hosting control panels it is a menu: find the PHP settings for the domain, choose a version from the list, and apply. The name of the screen differs from host to host.

  • cPanel's MultiPHP Manager lists the account's domains with the PHP version each one uses. Its documentation gives the steps: select the checkbox for the domain, select the version from the "PHP Version" menu, and click Apply. A version that is not in the menu is not installed on the server or not available for your account. The host can also switch this screen off.
  • On hosts that use CloudLinux's PHP Selector with cPanel, the screen is "Select PHP Version", in the Software section. Its documentation describes it as the place to manage "PHP extensions and options for the particular PHP version", and says changes are saved automatically.
  • Anywhere else, look for "PHP" in the panel or the host's help pages, or ask the host. WordPress.org's page links to a list of hosts' own instructions and has a short message you can send.

Three things do not change the PHP version.

  • The WordPress dashboard. The buttons in the PHP box are links. "Learn more about updating PHP" opens WordPress.org's page, or a page of the host's if the host has set one. A second button, "Update PHP", shows only when the host has given WordPress the address of its own screen for it.
  • A plugin. A plugin is PHP code. It runs inside the PHP the server has already started.
  • wp-config.php. It is a PHP file too, read after PHP has started. It holds WordPress's settings, not the server's.

On a cPanel server the choice can be recorded in the site's .htaccess file, which the panel writes: cPanel's documentation says that when you set a domain's PHP version "the system creates its .htaccess file". It strongly recommends setting the version only through its own screens, and warns that a version set by hand can behave unexpectedly. So do not write those lines yourself, and do not delete them when you tidy .htaccess.

One version at a time, or straight to the target?

No rule says either. php.net publishes a migration guide for each step, such as 8.2 to 8.3, and each has a list of backward incompatible changes and a list of deprecated features. Going from 7.4 to 8.3 crosses four of those guides at once. On a staging copy, try the version you want to end on. If more breaks than you can sort out, an in-between version that php.net still supports is a place to stop for a while.

After the switch

Do this on the staging copy first, and again on the live site when you switch it.

  1. Step 1: Confirm the version the site runs

    Open Tools, Site Health, Info, Server, and read "PHP version" again. The hosting panel shows what was asked for. This shows what the site runs. If it still shows the old number, something is holding the site on that version: the fix named "Remove what keeps the site on another PHP version" on the missing MySQL extension page shows where to look.

  2. Step 2: Look for missing modules

    On the Status tab, look for "One or more required modules are missing" or "One or more recommended modules are missing". Open it for the names. Each is given as "The required module, …, is not installed, or has been disabled." or "The optional module, …, is not installed, or has been disabled." The result links to the hosting team's list of the extensions WordPress requires and recommends.

    Extensions are switched on for each PHP version separately, so the new version may lack one the old version had. Switch it on in the panel's list of extensions for the new version, or ask the host to.

  3. Step 3: Check the settings you wrote down

    Compare the memory limit, the upload size and the other rows with your note. Set again what the site needs, in the panel's PHP options for the new version.

  4. Step 4: Click through the site

    Open the home page, a post and a page. Send a form. Search. Log in, edit a post and save it, and upload an image. On a store, add a product to the cart and go through the checkout.

  5. Step 5: Read the log

    Open wp-content/debug.log. The commands under these steps pick out what matters.

  6. Step 6: Turn the debug log off and delete it

    Do this on the live site as soon as you have your answer.

One missing extension takes the whole site down. If every address shows "Your PHP installation appears to be missing the MySQL extension which is required by WordPress.", the new version has no mysqli. That page has the fix, and nothing is lost meanwhile.

What the log says

A line that begins PHP Deprecated is code that works on this PHP and that a later version is due to stop running:

text
[10-Oct-2026 12:04:02 UTC] PHP Deprecated:  Creation of dynamic property Example_Gallery::$columns is deprecated in /home/example/public_html/wp-content/plugins/example-gallery/example-gallery.php on line 10

Nothing is broken yet. The path names the plugin or theme, here one in a folder named example-gallery. This counts the deprecation lines for each plugin and theme folder, the most first:

bash
grep "PHP Deprecated" wp-content/debug.log | grep -oE "wp-content/[a-z-]+/[^/ :]+" | sort | uniq -c | sort -rn

Update what it names, or send the lines to the author. Lines whose file is inside WordPress's own folders are left out of the count. Read those in the log itself.

A line that begins PHP Fatal error or PHP Parse error is a page that stopped. This prints the last three:

bash
grep -E "PHP (Fatal|Parse) error" wp-content/debug.log | tail -n 3

When you are done, set WP_DEBUG back to false in wp-config.php, remove the other two lines and delete wp-content/debug.log. With WP-CLI:

bash
wp config set WP_DEBUG false --raw
wp config delete WP_DEBUG_LOG
wp config delete WP_DEBUG_DISPLAY
rm -f wp-content/debug.log

If a page shows a critical error on the new version

"There has been a critical error on this website." is what WordPress shows in place of a page when PHP stops with a fatal error. After a change of PHP version, suspect a plugin or a theme that calls something the new version no longer has. The line in the log looks like this:

text
[10-Oct-2026 12:04:12 UTC] PHP Fatal error:  Uncaught Error: Call to undefined function create_function() in /home/example/public_html/wp-content/plugins/example-slider/example-slider.php:6

PHP 8.0 removed create_function(), so code that still calls it stops on every version from 8.0 on. The path names the plugin, here example-slider. You have three ways forward.

  • Set the PHP version back at the host. The site comes back on the old version, and you can deal with the plugin without visitors watching.
  • Use WordPress's recovery mode. Open the login page. When the failing file belongs to a plugin or a theme, WordPress emails the site's administrator a link, and through that link the plugin is paused for you alone so that you can log in and deactivate it. How to fix "There has been a critical error on this website" goes through it, and through what to do when no email comes.
  • Switch the one plugin off and stay on the new version. With WP-CLI, by the name of its folder:
bash
wp plugin deactivate plugin-folder-name --skip-plugins --skip-themes

The two extra options keep WP-CLI from loading the broken code while it runs.

Then update the plugin if a newer release exists, send the line to its author, or replace it. If two plugins seem to be involved, how to find and fix a WordPress plugin conflict shows how to prove which one it is.

Going back to the previous version

Use the same menu and choose the version the site ran before. Changing the PHP version does not rewrite the site's content or its database, so going back needs no restore. Restore the backup only if something was saved wrongly while the site was failing, and set the PHP version back first: that is the order WordPress.org gives.

Two things can stand in the way. A version the host has removed is no longer in the list. And cPanel's documentation says that if the system administrator has limited a domain's PHP version, you cannot use MultiPHP Manager to set the domain back to its original version. In either case, write to the host. WordPress hosting problems: how to tell whether the fault is the host or the site has a message you can adapt.

Treat an end-of-life version as a place to wait, not to stay. Every month there is one more without security fixes, and the plugins and WordPress itself move their minimum up in the meantime.

If a plugin stops on the new version and you cannot find which one or why, a one-time fix from WP Ministry covers one issue on one site and starts with a free diagnosis, which gives you a written cause and a fixed quote.

Common questions

Will updating PHP break my site?

It can. WordPress.org puts it this way: "Updating your PHP version should not be a problem, but we can't guarantee that it's not." WordPress 7.1 itself is listed as compatible with PHP 7.4 to 8.5. What needs trying is your plugins and your theme, which is what the staging copy is for.

Can I update PHP from the WordPress dashboard or with a plugin?

No. PHP is the server's program, and WordPress and its plugins run inside it. The buttons WordPress shows about PHP are links to instructions. The change is made in the hosting panel or by the host.

WordPress shows no warning about PHP. Does that mean my version is fine?

Not by itself. The warning repeats WordPress.org's answer, which on October 10, 2026 still counted PHP 8.1 as receiving security updates, months after php.net listed it as end of life. Check your version against php.net, or in the end-of-life checker.

Why does WP-CLI show a different PHP version from Site Health?

They are two programs. The website's PHP is the one the hosting panel sets for the domain. The command line's can be another version installed on the same server. Site Health gives the website's version and wp --info gives the command line's.

My host changed the PHP version and the site broke. What now?

Ask the host to set the previous version back if it is still offered, which brings the site back while you find the cause. If it is not, read the newest fatal line in the log, or use the recovery link WordPress emails, and switch off the plugin it names. How to fix "There has been a critical error on this website" has each step.

More on this subject

Quick Fix, done for you

Quick Fix is $49. One issue, one site, up to about an hour. No fix, no fee. 30-day warranty. It starts with a free diagnosis.