Module 8 · 8.4
English
PHP versions and upgrades
Module 8: Backups, staging and PHP upgrades · Reading time: 10 minutes
Learning objective: After this lesson you'll be able to safely prepare, carry out and, if necessary, roll back a PHP upgrade.
Key concepts: PHP lifecycle (active support, security only, end of life), compatibility of WordPress, theme and plugins, deprecated, warning, fatal error, Site Health, error log, staging, restore, having an upgrade done for you
Why PHP versions matter
WordPress, your theme and your plugins are written in PHP (lesson 1.2). A new version of PHP is released every year (8.3, 8.4, 8.5, ...). Each version is maintained for a fixed period:
- active support: two years of bug and security fixes;
- security only: a further two years of security fixes only;
- end of life: no more fixes, not even for vulnerabilities.
The situation on 8 November 2026, according to php.net:
| Version | Security updates until | Status |
|---|---|---|
| 8.1 and older | (past) | No more updates |
| 8.2 | 31 December 2026 | Security only, nearly at end of life |
| 8.3 | 31 December 2027 | Security only |
| 8.4 | 31 December 2028 | Active |
| 8.5 | 31 December 2029 | Active |
A website running on a version with no updates runs on software with known vulnerabilities that no longer get fixed. Newer versions are also noticeably faster (lesson 6.3). And wordpress.org recommends PHP 8.3 or higher (as of November 2026). So the idea is to keep up every year, not to make one big jump every five years.
Why an upgrade can break things
Every new PHP version changes something. Functions that have been marked as deprecated for years get removed, and rules become stricter. A few well-known examples:
- PHP 8.0 removed
create_function()andeach(), among others, and many warnings became errors; - PHP 8.2 marked dynamically creating properties on objects as deprecated, which is common in older plugins.
There are three kinds of messages, and the difference matters:
| Message | Meaning | Effect |
|---|---|---|
| Deprecated | "This still works, but will be removed in a future version" | Nothing visible; a warning for the future |
| Warning or Notice | Something isn't quite right | Usually nothing visible, occasionally a component behaves oddly |
| Fatal error | PHP stops | A blank page or "critical error" (lesson 5.4) |
WordPress itself usually keeps up well with new PHP versions. The risk lies in old plugins and themes, especially if they haven't been updated in a long time or are custom-built.
Finding your current version
- In WordPress: Tools > Site Health, Info tab, under Server: the PHP version. Site Health also warns you if your version is outdated.
- In your hosting panel: in DirectAdmin with CloudLinux, under Select PHP version (with "(current)" after the current version).
- Sometimes the server reveals it in the
X-Powered-By: PHP/8.3.xheader. Better not to have this visible (lesson 7.4), but if it's there, it's quick to check.
Note: with many hosts, the PHP version applies to your whole package, meaning all websites within it. An old website in the same package can hold you back. That's another reason to clean up old websites or give them their own package.
The upgrade: step by step
- Update first. Update WordPress, your theme and all your plugins on the current PHP version. This already resolves a large share of problems, because developers adjust their code for new PHP versions.
- Check what your plugins say. The wordpress.org plugin page states the required PHP version; the changelog often says "compatible with PHP 8.x". A plugin that hasn't been updated in years (lesson 5.3) is a candidate for replacement.
- Make a backup (lesson 8.1).
- Test on staging (lesson 8.3). If your host can give you a different PHP version per website, set the staging site to the new version. If that's not possible (one version per package), test on a staging site in a different package, locally, or choose a quiet moment on production with the old version ready to restore.
- Switching over: choose the new version in your panel. In DirectAdmin with CloudLinux, choose it under Select PHP version and click Apply; without Apply, nothing changes.
- Check immediately: open your website and click through a few pages, including the dashboard, a form and (for a shop) the checkout. Check the error log (lesson 5.4) for new
PHP Fatal errorlines. - Extensions and settings: with some hosts, PHP extensions and options (such as
memory_limit) belong to a specific version. After switching, check that they're set correctly for the new version.
If something goes wrong
- Fatal error: restore the old version (possible immediately with most hosts), so your website works again. Find out in the error log which plugin or theme was the cause (the path is in the error message), update it, replace it, or ask the developer for a fix. Then try again.
- Only deprecated messages: no reason to go back. But it's a warning: in the next version it might become an error. Note down which plugin it is.
- Custom code that no longer works: an old website built by a web developer may contain code that nobody maintains any more. That code then needs to be adjusted by someone who knows PHP. Some hosts, including WebOké, offer to do this for you.
Don't leave a website on an old version "forever" because one plugin can't keep up. That just postpones a problem that grows bigger every year.
More certainty in advance
For those who want to go further: with PHP_CodeSniffer and the rules from PHPCompatibilityWP, you can have the code of your plugins and themes checked for things that won't work in a newer PHP version, without running the website. This finds a lot, but not everything. Testing on staging remains necessary.
In practice: what it looks like in a panel
As an example, we use DirectAdmin with CloudLinux. In cPanel it's often called MultiPHP Manager or Select PHP Version, in Plesk, PHP Settings.
- Open Select PHP version (under Extra Features).
- Click the version under PHP version, choose the new version and click Apply.
- Check the Extensions and Options tabs for the new version.
- Check your website and the error log. If something doesn't work, choose the old version and Apply.
Summary
- Every PHP version gets two years of active support and two years of security only; after that, no more fixes. On 8 November 2026, 8.1 gets nothing more, and 8.2 gets updates until the end of 2026.
- An upgrade mainly breaks old plugins and themes; deprecated is a warning, a fatal error stops the website.
- Order of steps: update everything, check plugins, make a backup, test on staging, switch over, check immediately.
- If something goes wrong, restore the old version, find the culprit in the error log and fix it; don't get stuck on an old version.
- With many hosts, the version applies to the whole package; clean up old websites.
Quiz
Exercise
Exercise A8.4: Is your PHP version still supported? Check Tools > Site Health (Info tab, Server) to see which PHP version your website uses, and enter it along with your domain. The tool compares the version against the list of supported versions from php.net: green for active support, orange for security only, red if no more updates are coming. If your server shows the version in the X-Powered-By header, the tool also checks whether it matches what you entered (and lets you know you'd better hide that header, lesson 7.4).
Exercise D8.4: An upgrade plan. Write a plan for upgrading your website to the newest PHP version your host offers. Fill in: current and target version, which plugins and themes you have and whether they support the target version (with where you read that), where you'll test (staging, a different package, locally), how you can roll back, and when you'll do it. Carry it out if you can, and note what appeared in the error log.
Exercise D8.4: An upgrade plan
You do this exercise yourself; no one checks it. Tick off what you've done and mark the exercise as done.
Choose a target version with active support (or at least still receiving security updates), and name a source for each plugin (plugin page, changelog, Site Health).
Your ticks and notes only stay in this browser; we don't send them anywhere. If you're signed in, we only save in My courses that you've done the exercise.
Further reading
These articles describe the steps in WebOké's panels; in other panels they work in a similar way.
- DirectAdmin guide 14.1: Selecting the PHP version (Select PHP version)
- DirectAdmin guide 14.6: Errors after a PHP upgrade and finding the error log
- PHP version and PHP settings: how to change them (and what to do about errors after an upgrade)
- DirectAdmin guide 14.2: Enabling and disabling PHP extensions
- WebOké manual 6.11: Having a PHP upgrade done
- Supported PHP versions (php.net, English): https://www.php.net/supported-versions.php
- PHP and WordPress versions (make.wordpress.org, English): https://make.wordpress.org/core/handbook/references/php-compatibility-and-wordpress-versions/
