---
title: How to Update the PHP Version in WordPress Safely
description: "How to update the PHP version in WordPress: check what you run, scan plugins, test with the debug log, switch in your host panel and roll back. Tested."
url: "https://skybootstrap.com/update-php-version-wordpress/"
canonical_url: "https://skybootstrap.com/update-php-version-wordpress/"
date: "2026-11-16T17:48:03+06:00"
modified: "2026-11-16T17:57:37+06:00"
author: Skybootstrap Team
type: article
site: SkyBootstrap
language: en-US
---

# How to Update the PHP Version in WordPress Safely

To update the PHP version in WordPress safely, check which version the site runs in Site Health, then pick PHP 8.4 or 8.5. Scan your plugins for compatibility, test the new version on a staging copy with the debug log on, and switch it in your hosting panel. If anything breaks, switch back the same way.

We switched a copy of our test site from PHP 8.3 to 8.5 and back, after scanning its plugins first. The scanner flagged three plugins, yet the site’s pages ran on 8.5 without one new PHP notice; switching back took 0.2 seconds on our server.

## Check your PHP version in Site Health

PHP is the language WordPress runs on, and your host decides which version of it runs your site. Site Health, under **Tools > Site Health**, shows it: open the **Info** tab, then the **Server** section, and read the “PHP version” line.

![Site Health Info tab, Server section, showing PHP version 8.5.12 and PHP SAPI fpm-fcgi](https://skybootstrap.com/wp-content/uploads/2026/11/update-php-version-wordpress-site-health-php-version.webp "Site Health on our test copy after the switch: WordPress 7.1.4 on PHP 8.5.12, 11 Nov 2026. Server details blurred.")

The “PHP SAPI” line below it shows how the server runs PHP; ours said `fpm-fcgi`, meaning PHP-FPM.

Check it there, not only on the command line. During our test, a page served by the site reported PHP 8.5.12, while `php -v` and `wp --info` on the same server both said 8.3.6. Some servers run the website and the command line on different versions, so the dashboard is the number that counts.

## Which PHP version to choose for WordPress

Choose PHP 8.4 or 8.5. WordPress’s [server compatibility page for version 7.1](https://make.wordpress.org/hosting/handbook/compatibility/version/7-1/) recommends “PHP: 8.4.x, 8.5.x” for new installs, and states: “WordPress 7.1 is fully compatible with PHP 7.4 (1), 8.0 (1), 8.1 (1), 8.2, 8.3, 8.4 and 8.5.”

The footnote on 7.4 to 8.1 matters: those versions are end-of-life, kept working “for backward compatibility only”. PHP 8.2 joins them on 31 December 2026, when its security support ends.

You may have read that newer PHP versions only have “beta support” in WordPress. That label is gone: a [core team post from 22 May 2026](https://make.wordpress.org/core/2026/05/22/php-support-clarification-2026/) says its use “has been retired”, for every WordPress version. Kinsta’s guide picks 8.4 as the safer default; 8.5 is newer, so check your plugins carefully either way.

## Scan plugins and themes for PHP compatibility

WordPress itself supports these versions, but your plugins and theme have to as well. [PHPCompatibilityWP](https://github.com/PHPCompatibility/PHPCompatibilityWP) is a free rule set for PHP_CodeSniffer, a command-line code checker, that reads PHP files and lists code that changed or was removed in the PHP versions you name.

Its README names Composer as the only supported way to install it, and the version that knows PHP 8.4 and 8.5 is still a pre-release (3.0, which needs PHPCompatibility 10). In a project folder, the README’s command is:

```
composer require --dev phpcompatibility/phpcompatibility-wp:"^3.0@dev"
vendor/bin/phpcs --standard=PHPCompatibilityWP --runtime-set testVersion 8.4- --extensions=php /path/to/wp-content/plugins/your-plugin
```

`8.4-` means “8.4 and every newer version”, so it covers 8.5 too. We installed the same tools from their release tags instead of Composer. Without SSH, download a plugin’s folder as a zip from your host’s file manager and scan it on your own computer; we didn’t test that route.

We ran it on our test site for PHP 8.4 and newer, and again for 8.5 and newer. Both runs gave the same results:

| Plugin or theme | Errors | Warnings | What it found |
| --- | --- | --- | --- |
| Contact Form 7 6.2.5 | 0 | 0 | Nothing |
| Twenty Twenty-Five | 0 | 0 | Nothing |
| Query Monitor 4.1.1 | 0 | 1 | The `E_STRICT` constant, deprecated in PHP 8.4 |
| Redis Object Cache 3.0.0 | 0 | 8 | `curl_close()`, deprecated in 8.5; `stream_context_set_option()` parameters; older style in a test file |
| WordPress Importer 0.9.6 | 2 | 4 | Errors in a test file bundled with a library; `xml_parser_free()`, deprecated in 8.5; `libxml_disable_entity_loader()` |

Read those results carefully. Most were deprecation notices: a deprecation notice is PHP’s warning that a function will be removed in a later version, while the code still runs today. Kinsta’s guide puts it plainly: “Deprecation notices are warnings, not errors.” The two errors sat in a test file bundled with a library, which the plugin’s loader doesn’t include.

Then we looked at where each flag sat in the code. None of it runs on our setup: Query Monitor’s `E_STRICT` line only runs below PHP 8.4, the importer’s `libxml_disable_entity_loader()` only below 8.0, and its `xml_parser_free()` call sits in a fallback parser it uses only when SimpleXML is missing. The Redis code loads only with an object cache turned on, which our copy didn’t have.

We checked that on PHP 8.5. With the importer’s default parser, a test file parsed cleanly with nothing in the debug log. When we forced the fallback parser, it parsed the same file and logged one line: “Function xml_parser_free() is deprecated since 8.5”. The import still worked; that’s what a deprecation notice looks like in practice.

A scan tells you where to look; only a test run tells you whether anything breaks. Update flagged plugins before switching, one at a time as our guide to updating WordPress safely shows, since a newer release may already fix what the scan found.

On each plugin’s WordPress.org page, “Requires PHP” gives only the lowest version it needs, not the highest it works with. The last update date and the changelog’s PHP notes say more: a plugin that hasn’t been updated in years is the one to test hardest.

## Test the new PHP version with the debug log on

Test on a copy first. Our staging guide shows how to make one. Before switching, turn on the debug log, a file where WordPress writes PHP errors and notices instead of showing them to visitors. Open wp-config.php, find the line `define( 'WP_DEBUG', false );`, and replace that line with these three:

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

The [WordPress handbook](https://developer.wordpress.org/advanced-administration/debug/debug-wordpress/) says this setup “will log all errors, notices, and warnings to a file called `debug.log` in the `wp-content` directory”. Replace it rather than adding below it: when we left the old `false` line above new ones, the first one won and `debug.log` was never created. Switch the copy to the new PHP version, then click through it: the homepage, a post, search, the login page, your forms and the main admin screens.

Then open `wp-content/debug.log`. On our copy, PHP 8.5 changed nothing we could see. All nine front-end URLs we tested returned the same status codes as on 8.3, and none added a line to the log. The dashboard, plugin and Site Health screens loaded too; the only log lines they added said our offline test server couldn’t reach WordPress.org.

Here’s how the two versions compared on our copy:

| | PHP 8.3 | PHP 8.5 |
| --- | --- | --- |
| Front-end URLs with the same result | 9 of 9 | 9 of 9 |
| New lines in debug.log (front-end pages) | 0 | 0 |
| Homepage response time (median of 10) | 0.156 s | 0.143 s |
| Site Health modules check | imagick missing | imagick missing |

The speed difference is small and comes from one uncached copy on one machine, so treat it as “no slower”, not as a gain to expect. Once you’re done, put `define( 'WP_DEBUG', false );` back in place of the three lines and delete `wp-content/debug.log`: anyone who guesses its address can usually open it in a browser.

## Update the PHP version for WordPress in your hosting panel

Update the PHP version in your hosting panel once the copy passes. In cPanel, that’s usually **Software > MultiPHP Manager**: tick your domain, choose the version and apply. Hosts running CloudLinux show **Select PHP Version** instead, often with a list of extensions to tick; other hosts have a PHP setting per site. We didn’t test host panels: on our own server, the switch meant pointing the web server at the new PHP-FPM, the process manager that runs PHP for the site.

Check one more thing right after switching: PHP extensions, the add-on modules that give PHP extra features. They’re installed per PHP version, so a new version can be missing one the old one had. Our PHP 8.5 lacked several modules our 8.3 packages included, such as redis and sodium. Site Health’s Status tab warns about missing modules WordPress recommends, but not about every module: ours listed only imagick, missing on both versions, and said nothing about redis or sodium.

If a plugin needs a missing module, such as an object cache plugin that uses the redis module, enable it in that extensions list or ask your host.

Our first switch also showed what a broken PHP setup looks like: every page returned an error, and the log said `mysqli_real_connect(): (HY000/2002)`, because our self-built PHP didn’t know where the database socket was. If you see that after switching, ask your host to check the new version’s database settings.

## Roll back the PHP version if something breaks

To roll back, choose the previous PHP version in the same setting and save. Duplicator’s guide agrees. Its first step: “Start by switching back to your previous PHP version, using the same host setting you used to update.” On our server, pointing back at PHP 8.3 had the site answering on 8.3 within 0.2 seconds.

Then read `debug.log` to find which plugin or theme failed, and update or replace it before trying again. If a fatal error locks you out, our [critical error guide](https://skybootstrap.com/there-has-been-a-critical-error-on-this-website/) shows how to find the cause. Make a backup before the switch either way, since rolling back PHP doesn’t undo anything a plugin wrote to the database while it ran.

The WordPress maintenance checklist puts a PHP version check into its quarterly routine.

## How we tested

Our test copy ran WordPress 7.1.4 on nginx and MariaDB, first on Ubuntu’s PHP 8.3.6 packages and then on PHP 8.5.12, which we built from the official source tag. We scanned its plugins and theme with PHP_CodeSniffer 4.0.4 and PHPCompatibilityWP 3.0.0-alpha2, for 8.4 and 8.5.

Then we switched the copy, compared status codes, the debug log, admin screens and response times, ran the flagged importer, and switched back. Host panels, PHP 8.4 at runtime, page builders and WooCommerce were left out.

## Frequently Asked Questions

### Will updating PHP break my WordPress site?

Updating PHP breaks a site only when a plugin or theme uses code the new version removed. On our copy, moving from 8.3 to 8.5 changed nothing visible, even with three plugins flagged by the scanner. Test on a copy with the debug log on, and keep the old version ready to switch back.

### Is PHP 8.5 safe for WordPress?

On WordPress 7.1, PHP 8.5 is fully supported: WordPress lists 7.1 as compatible with it and recommends 8.4 or 8.5 for new installs. Whether it’s safe for your site depends on your plugins, so scan and test them first.

### What’s the difference between a deprecation notice and an error?

A deprecation notice warns that code will stop working in a future PHP version; the code still runs now. A fatal error stops the page. Notices belong in the debug log, not on screen, and are worth passing to the plugin’s developer.