# Updating PHP under WordPress

> Deprecated functions, incompatible plugins, fatal errors: what a PHP version upgrade genuinely breaks on WordPress and WooCommerce, and how to test it before switching.

- Source canonique : [https://allaux.fr/en/wordpress-woocommerce/mise-a-jour/php-wordpress](https://allaux.fr/en/wordpress-woocommerce/mise-a-jour/php-wordpress)
- Langue : EN
- Dernière mise à jour : 2026-09-30

## Direct answer

> Raise PHP on a clone before production, never the other way round. Update the core, the plugins and the theme first, because it is old code that breaks on a recent PHP. Then switch the version in the host control panel, browse the site with WP_DEBUG_LOG enabled and read wp-content/debug.log: deprecation notices show up there before they turn into fatal errors.

## Where WordPress actually stands on PHP

The minimum version technically supported by WordPress core is PHP 7.4, but that version has reached end of life: it hasn’t received a security fix since late November 2022 and shouldn’t be running in production any more. WordPress.org officially recommends PHP 8.3 or higher. On the WooCommerce side, the minimum to function properly is PHP 8.1, with PHP 8.3 also recommended, a memory limit of at least 256 MB, and MySQL 8.0 or MariaDB 10.4 as a minimum (10.6 or higher being preferable).

A site still on PHP 7.4, or an even older version, isn’t just slower: it’s running without security patches on the language itself, a risk distinct from anything related to the WordPress or plugin versions.

## Why a PHP upgrade breaks a WordPress site

- An old plugin calls a PHP function removed in the new version: an immediate fatal error instead of a simple notice
- Code that tolerated inconsistent data types (a string passed where an integer was expected, for example) throws a fatal error under PHP 8+, where it used to just produce a silent notice
- A plugin abandoned by its author, never updated in years, that simply was never tested against PHP 8
- A theme with old bespoke code, written before these functions were deprecated, with no plugin involved at all

## How I check a PHP upgrade before switching

1. **Full backup** — Files and database, before touching anything, so I can roll back if needed.
2. **Enabling the compatibility report** — I review the site’s code with WP_DEBUG enabled and a PHP compatibility scanning tool, to spot calls to deprecated or removed functions before changing anything with the host.
3. **Testing on an environment with the target version** — I duplicate the site on an environment configured with the target PHP version and run it under real conditions, never directly on the production server.
4. **Fixing the blocking points** — I fix the bespoke code involved, or replace incompatible abandoned plugins with maintained alternatives.
5. **Switching at the host** — Once testing is conclusive, I change the active PHP version in the hosting configuration, during a low-traffic window, and monitor the site’s behaviour immediately after.

## Never change the PHP version blind

> Switching the PHP version at the host directly without testing first means discovering the fatal errors in front of visitors. On shared hosting, this change is sometimes a single click in the admin panel: how easy it is doesn’t excuse skipping the check.

## Checking after the switch

> I check the server error log right after the change, the display of pages, the WooCommerce checkout if present, and the behaviour of every sensitive plugin over the following hours.

## Related pages

- **What to do when a version reaches end of support** — PHP 7.4 hasn’t had a security fix since late 2022: what that means for a site still running it. ([/wordpress-woocommerce/mise-a-jour/fin-de-support-version](/wordpress-woocommerce/mise-a-jour/fin-de-support-version))
- **Checking plugin compatibility before an update** — The method to know whether a theme or plugin will survive the move to the new version, before clicking "update". ([/wordpress-woocommerce/mise-a-jour/verifier-extensions-avant-mise-a-jour](/wordpress-woocommerce/mise-a-jour/verifier-extensions-avant-mise-a-jour))
- **Enabling WordPress debug mode** — How to enable WP_DEBUG properly so errors and notices surface without exposing them to visitors. ([/guides/activer-mode-debug-wordpress](/guides/activer-mode-debug-wordpress))
- **Choosing e-commerce hosting** — What actually matters when choosing a host for a WooCommerce shop, beyond the advertised price. ([/guides/choisir-hebergement-ecommerce](/guides/choisir-hebergement-ecommerce))

## FAQ

### Which PHP version should you target today?

PHP 8.3, recommended by both WordPress.org and WooCommerce. WooCommerce runs from PHP 8.1 onward, but targeting the recommended version directly avoids another upgrade in the short term.

### My site still runs on PHP 7.4, should I be worried?

Yes. PHP 7.4 hasn’t received a security fix since late November 2022. This isn’t about performance but about unpatched flaws in the language itself.

### How do you know if a plugin will break under PHP 8?

A PHP compatibility scan of the plugin’s code and a real test on an environment configured with the target version remain the two reliable methods: a plugin’s listing rarely states accurate, up-to-date compatibility.

### Can you change the PHP version without touching WordPress or WooCommerce?

Yes, the PHP version is changed on the hosting side, independently of the installed WordPress or WooCommerce versions. That’s exactly why it can break things with no obvious link to a plugin update.

### What happens if an abandoned plugin breaks after the upgrade?

I replace the plugin with a maintained alternative offering equivalent functionality, or rebuild the feature as bespoke code if no reliable alternative exists.
