Upgrading PHP
Upgrading PHP gives the site the security and performance changes that come with the version you select, and lets themes and plugins use features from that version.
PHP versions older than 8 are end of life on php.net (PHP: Supported Versions). Upgrade to at least PHP 8.1.x. That version is compatible with current WordPress core versions and with most actively developed plugins and themes.
When a PHP version reaches end of life, Pressidium removes it from the versions you can choose when you create a new website. Existing websites that already run that version keep it until you switch.
Switching PHP version in the Dashboard is not the same as applying a security patch to the version you already run. You choose the runtime.
To confirm a named CVE or whether a security patch was applied to the version you already run, follow How Pressidium applies PHP security updates or open a Support request.
A notice in WordPress Admin from a plugin that tells you to update PHP is not a message from Pressidium. Confirm the version in PHP Engine, then follow the compatibility steps below before you switch. Do not switch production only because a plugin showed that notice.
Review the site for compatibility issues before you change version. New PHP major versions introduce backward-incompatible changes.
Before you switch, work through these checks.
Take a backup of your website
Create a backup before you change PHP, so you can recover if something fails. Create and download a full backup from the Dashboard, and use Instant backups to roll back to a previous version when you upgrade themes or plugins.
Upgrade WordPress core to a recent or latest version
Pressidium manages WordPress core through WordPress Safe Updates. If the site was excluded from those updates, or is not yet updated, manually upgrade WordPress via the Dashboard.
Check the WordPress PHP compatibility matrix for the compatibility chart and notes about PHP version-related changes.
Review your themes and plugins for compatibility with the target upgrade version
Review your active theme and plugin documentation to confirm they support the version you want to use. Not all plugins and themes are compatible with the newest PHP versions. If a plugin or theme breaks after the switch, switch back to the previous PHP version and contact the plugin or theme developer about the incompatibility.
Upgrade your themes and plugins to their latest versions
Upgrade themes and plugins to their latest versions, or to the most recent version that supports the PHP version you are switching to.
Review your website error logs
Review the site error logs for PHP warnings or deprecation notices. You might need to enable WordPress debug mode so the logs include more detail. See how to enable WP_DEBUG mode.
Make a post-upgrade testing plan
List URLs, pages, or use cases to check after the upgrade. Examples:
adding products to a cart for an e-shop
signing up for a course in an LMS
filling forms
carrying out common administrative work in the WordPress admin interface
reviewing and visiting key pages or popular pages based on traffic
reviewing scheduled tasks, such as importing products or running email campaigns
Prefer gradual updates
If you upgrade across several PHP versions, upgrade in sequence, for example from PHP 7.4 to PHP 8.0, then to PHP 8.1. That helps you isolate issues that appear on a specific version.
Use a staging environment
Use the website’s staging environment to test the PHP upgrade, fix theme and plugin compatibility issues, and switch production only when those issues are resolved.
Use a website clone for debugging and testing
You can clone the website and use the clone as a test bed for the upgrade. That leaves the original staging environment free for its existing workflow.
Review the official PHP migration guides and backward incompatible features page
The PHP documentation site publishes guides for upgrading and lists backward-incompatible changes in newer versions.
Migrating from PHP 7.0.x to 7.1.x
Migrating from PHP 7.1.x to 7.2.x
Migrating from PHP 7.2.x to 7.3.x
Migrating from PHP 7.3.x to 7.4.x
Migrating from PHP 7.4.x to 8.0.x
Migrating from PHP 8.0.x to 8.1.x
Migrating from PHP 8.1.x to 8.2.x
Migrating from PHP 8.2.x to 8.3.x
Migrating from PHP 8.3.x to 8.4.x
Advanced: use a compatibility checker tool
If you use the command line, run automated upgrade checks with the PHP Compatibility Coding Standard for PHP CodeSniffer in a local development environment. Use it to analyze your code and third-party plugins and themes for compatibility with higher and lower PHP versions.
Need help?
If you are not sure whether the site is ready for a PHP upgrade, or the site shows errors after upgrading PHP, open a Support request before you switch PHP version.
Include the website, the PHP Engine minor versions for Production and Staging, and what you observed.
Where to go next
How Pressidium applies PHP security updates if you asked about a CVE or a patch on the PHP version you already run.
Switch your PHP runtime for the Dashboard steps.
Create an Instant backup before upgrading PHP on production.
Enable WordPress debug logs if you need to investigate errors after the upgrade.
Override PHP.ini variables if the site needs custom PHP configuration after upgrading.
Was this article helpful?