How to Check and Upgrade Your PHP Version Safely (WordPress, WooCommerce, Magento)

Old PHP versions are slow and unsafe. Here is how to check which PHP version your site uses, test compatibility and upgrade WordPress, WooCommerce or Magento sites without downtime.

Running an outdated PHP version is one of the most common risks on business websites. Old versions stop receiving security fixes, and newer versions are usually faster. Critical vulnerabilities such as PHP2Shell show how quickly this becomes urgent.

There are two different tasks:

  1. Patching: updating to the latest release within your branch (for example 8.3.x to the newest 8.3). Low risk, do it immediately.
  2. Upgrading: moving to a newer branch (for example 8.2 to 8.4). Needs compatibility testing.

This guide covers both.

How to check your PHP version

On the server

php -v

This shows the command-line version. Your website may use a different one. Check the web server’s PHP too:

ls /etc/php/
systemctl list-units | grep -i php

In WordPress

Tools → Site Health → Info → Server.

In Magento 2

Magento runs on the server’s PHP-FPM or Apache PHP. Ask your host or check which FPM service your Nginx configuration uses.

In hosting panels

cPanel (“Select PHP Version” or MultiPHP Manager), Plesk (PHP settings per domain), DirectAdmin and others show the PHP version per site.

Quick check with a temporary file

Create info.php with <?php phpinfo(); in a non-obvious location, open it, check the version and delete it immediately. Never leave a phpinfo page online.

Which PHP versions are supported?

Each PHP branch gets about two years of active support and then security fixes for a further period. Check the official “Supported Versions” page on php.net for current dates. At the time of writing, 8.2 reaches end of life on 31 December 2026, so sites on 8.2 or older should plan an upgrade to 8.4 or 8.5.

Step 1: Check application compatibility

Platform Where to check
WordPress Core supports recent PHP versions; plugins and themes are the real question
WooCommerce WooCommerce’s system requirements and each extension’s documentation
Magento 2 / Adobe Commerce Each Magento version supports specific PHP versions. You may need to upgrade Magento first
Laravel, Symfony Framework version requirements in composer.json

For custom code, a static analysis tool like PHPCompatibility (with PHP_CodeSniffer) or PHPStan can flag code that breaks on newer versions.

composer require --dev phpcompatibility/php-compatibility
vendor/bin/phpcs -p . --standard=PHPCompatibility --runtime-set testVersion 8.4 --ignore=vendor

Step 2: Update plugins, extensions and themes

Before switching PHP, update everything to the latest versions. Many compatibility fixes are already released. Remove plugins that are abandoned or no longer maintained.

Step 3: Test on staging

Create a staging copy and switch it to the new PHP version. Test:

  • Home, category, product and search pages
  • Cart and checkout with every payment method
  • Login, registration and account pages
  • Admin: saving products, orders, imports and exports
  • Contact forms and emails
  • Cron jobs and scheduled tasks
  • Integrations (ERP, CRM, feeds, payment webhooks)

Check the PHP error log for deprecation notices and warnings. Deprecations are not errors yet, but they become errors in later versions.

Step 4: Upgrade production

On a server you manage (Debian/Ubuntu example)

Install the new version alongside the old one, including the extensions your application needs:

sudo apt install php8.4-fpm php8.4-mysql php8.4-curl php8.4-gd php8.4-intl php8.4-mbstring php8.4-xml php8.4-zip php8.4-bcmath php8.4-soap

Copy your custom settings (memory limit, upload size, OPcache) from the old php.ini and FPM pool files to the new version, then point your web server to the new FPM socket:

fastcgi_pass unix:/run/php/php8.4-fpm.sock;

Reload:

sudo nginx -t && sudo systemctl reload nginx

Package availability depends on your distribution. Newer PHP versions on older distributions often come from a third-party repository; make sure that repository delivers security updates quickly.

On shared or managed hosting

Change the version in the control panel. Most panels allow switching back instantly if something goes wrong.

In Docker

Change the base image (for example php:8.4-fpm), rebuild, test and redeploy.

Step 5: Monitor and keep a rollback ready

Watch error logs, uptime and conversion rate for the first days. Keep the old PHP version installed (but patched) for a short time so you can switch back quickly, then remove it.

Common problems after a PHP upgrade

  • White screen / 500 error: a fatal error in a plugin or theme. Check the PHP error log
  • Missing extension: for example intl, bcmath or soap not installed for the new version
  • Different settings: memory_limit or max_execution_time back to defaults
  • OPcache disabled: check that OPcache is enabled for the new version
  • Cron uses the old CLI version: update the cron command path

Frequently asked questions

Will upgrading PHP speed up my website?

Often yes, especially when coming from old versions. Newer versions include engine optimisations.

Can upgrading PHP break my site?

It can, if plugins or custom code are not compatible. That is why you test on staging first.

How often should I upgrade PHP?

Apply patch releases as soon as they come out. Plan a branch upgrade at least every one to two years, before your version reaches end of life.

Need a safe PHP upgrade?

I upgrade PHP for WordPress, WooCommerce and Magento sites, including compatibility checks, staging tests and rollback plans. See my WordPress and WooCommerce and servers and backups services, or request help.