Skip to content

Cookie settings

Choose which kinds of cookies you allow. You can change your choice at any time via Cookie settings at the bottom of every page. Privacy statement

Necessary

Always on

Needed to log in, keep your cart and remember your choices. These are always on.

Which cookies?
  • weboke_sessie, weboke_klant, weboke_remember: your session and staying logged in
  • weboke_basket: your cart
  • wkBtwIncl: showing prices with or without VAT
  • wok_cookies: your cookie choice, 12 months

Measures which ad leads to a visit or order, so we do not pay for ads that do nothing.

Which cookies?
  • Google Ads via Google Tag Manager (_gcl_au, _gcl_aw), up to 90 days
  • OpenAI Ads, ads in ChatGPT
  • wok_aff: which partner referred you to us (affiliate programme), 60 days

4.6

Country and language

Each country has its own site, with prices and VAT for that country.

View

PHP versions and upgrades

Watch it in a short film

Viewing your PHP version in Select PHP version 0:37

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:

VersionSecurity updates untilStatus
8.1 and older(passed)No more updates
8.231 December 2026Security only, end of life soon
8.331 December 2027Security only
8.431 December 2028Active
8.531 December 2029Active

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() and each(), 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:

MessageMeaningEffect
Deprecated"This still works, but will disappear in a future version"Nothing visible; a warning for the future
Warning or NoticeSomething is not quite rightUsually nothing visible, sometimes a part that behaves oddly
Fatal errorPHP stopsWhite 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

  1. 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.
  2. 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.
  3. Make a backup (lesson 8.1).
  4. 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.
  5. 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.
  6. 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 error lines.
  7. 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.

  1. Open Select PHP version (under Extra Features).
  2. Click the version next to PHP version, choose the new version and click Apply.
  3. Check the Extensions and Options tabs for the new version.
  4. 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

1. What does it mean when a PHP version gets "security only" support?



2. After a PHP upgrade, the error log shows only "Deprecated" messages. What do you do?



3. What is the right order for a PHP upgrade?



4. You have two websites in one package. The new one can run PHP 8.4, the old one fails on anything above PHP 7.4. What is the problem and the solution?



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 A8.4: Is your PHP version still supported?



What you enter and what we find isn't stored. Your browser remembers your answers and whether you've passed the exercise. If you're signed in, we only save that you got the exercise (almost) right in My courses; you can delete that there too.

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.



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.

One moment…

Set up your domains

For each domain, arrange the nameservers, the link to your hosting and who becomes the owner.

Loading your domains…