Module 8 · 8.4
PHP versions and upgrades
Watch it in a short film
Module 8: Backups, staging and PHP upgrades · Reading time: 10 minutes
Learning objective: After this lesson you can safely prepare, carry out and, if needed, roll back a PHP upgrade.
Key concepts: PHP life cycle (active support, security only, end of life), compatibility of WordPress, theme and plugins, deprecated, warning, fatal error, Site Health, error log, staging site, restore, having the 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 comes out every year (8.3, 8.4, 8.5, ...). Each version is maintained for a fixed period:
- active support: two years of bug fixes and security fixes;
- security only: then another two years of security fixes only;
- end of life: no more fixes, not even for vulnerabilities.
The status on 8 November 2026, according to php.net:
| Version | Security updates until | Status |
|---|---|---|
| 8.1 and older | (passed) | No more updates |
| 8.2 | 31 December 2026 | Security only, end of life soon |
| 8.3 | 31 December 2027 | Security only |
| 8.4 | 31 December 2028 | Active |
| 8.5 | 31 December 2029 | Active |
A website on a version without updates runs on software with known vulnerabilities that will no longer be fixed. On top of that, newer versions are 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 something
Every new PHP version changes something. Functions that have been marked as deprecated for years are removed, and rules become stricter. A few well-known examples:
- PHP 8.0 removed, among others,
create_function()andeach(), and many warnings became errors; - PHP 8.2 deprecated the dynamic creation of properties on objects, 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 disappear in a future version" | Nothing visible; a warning for the future |
| Warning or Notice | Something is not quite right | Usually nothing visible, sometimes a part that behaves oddly |
| Fatal error | PHP stops | White 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 have not been updated for 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 control panel: in DirectAdmin with CloudLinux under Select PHP version (with "(current)" after the current version).
- Sometimes the server gives it away in the header
X-Powered-By: PHP/8.3.x. Better not (lesson 7.4), but if it is there, you can see it quickly.
Note: with many hosting providers, the PHP version applies to your whole package, so to all websites in it. An old website in the same package can hold you back. That is one more 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. That already solves a large part of the problems, because developers adapt their code for new PHP versions.
- Check what your plugins say. The plugin page on wordpress.org shows the required PHP version; the changelog often says "compatible with PHP 8.x". A plugin that has not been updated for years (lesson 5.3) is a candidate for replacement.
- Make a backup (lesson 8.1).
- Test on a staging site (lesson 8.3). If your hosting provider can give each website its own PHP version, set the staging site to the new version. If that is not possible (one version per package), test on a staging site in another package, locally, or pick a quiet moment on production with the old version ready to switch back to.
- Switch over: choose the new version in your control panel. In DirectAdmin with CloudLinux you choose it in Select PHP version and click Apply; without Apply nothing changes.
- Check straight away: open your website and click through a few pages, including the admin area, a form and (for a shop) the checkout. Look in the error log (lesson 5.4) for new
PHP Fatal errorlines. - Extensions and settings: with some hosting providers, PHP extensions and options (such as
memory_limit) belong to a version. After switching, check that they are set correctly for the new version.
If it goes wrong
- Fatal error: switch back to the old version (most hosting providers let you do this straight away), so your website works again. Find in the error log which plugin or theme caused it (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 switch back. But it is a warning: with the next version it may 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 nobody maintains any more. That code then needs to be adapted by someone who knows PHP. Some hosting providers, WebOké included, offer to do this for you.
Do not keep a website on an old version "forever" because one plugin cannot keep up. That only postpones a problem that grows every year.
More certainty in advance
If you want to go further: with PHP_CodeSniffer and the PHPCompatibilityWP rules you can have the code of your plugins and themes checked for things that will not work in a newer PHP version, without running the website. It finds a lot, but not everything. Testing on a staging site is still necessary.
In practice: what it looks like in a control panel
As an example we use DirectAdmin with CloudLinux. In cPanel it is often called MultiPHP Manager or Select PHP Version, in Plesk PHP Settings.
- Open Select PHP version (under Extra Features).
- Click the version next to 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 does not work, choose the old version and click Apply.
Summary
- Each PHP version gets two years of active support and two years of security fixes only; after that, no more fixes. On 8 November 2026, 8.1 gets nothing any more and 8.2 is supported until the end of 2026.
- An upgrade mainly breaks old plugins and themes; deprecated is a warning, a fatal error stops the website.
- Order: update everything, check plugins, backup, test on a staging site, switch over, check straight away.
- If it goes wrong, switch back to the old version, find the culprit in the error log and fix it; do not get stuck on an old version.
- With many hosting providers, the version applies to the whole package; clean up old websites.
Quiz
Exercise
Exercise A8.4: Is your PHP version still supported? Look in Tools > Site Health, Info tab, Server, to see which PHP version your website uses and enter it, together with your domain. The tool compares the version with php.net's list of supported versions: green for active support, orange for security only, red if there are no more updates. If your server shows the version in the X-Powered-By header, the tool also checks whether it matches what you entered (and tells you that you had 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 hosting provider 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 will test (staging site, another package, locally), how you can switch back, and when you will 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 control panels; other control panels 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
- Changing your PHP version and PHP settings (and what to do if you get 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): https://www.php.net/supported-versions.php
- PHP and WordPress versions (make.wordpress.org): https://make.wordpress.org/core/handbook/references/php-compatibility-and-wordpress-versions/
