Which PHP Version to Use: Support Dates and an Upgrade Plan
In this article10 sections
Which PHP version should your site run? The honest answer is the newest one that your code and your plugins support and that still receives security fixes. In practice that means knowing three things: the support dates of each version, which versions your software works with, and how to plan the move so it happens before a deadline and not after an incident. This guide explains how PHP releases are supported, how to decide which version to target, and how to build an upgrade plan for one site or for many, across cPanel, Plesk, Linux servers and Windows hosting.
Support dates matter because a version that has reached its end stops getting fixes for new security flaws. Every flaw found afterwards stays open, and attackers read public advisories. The real-world example in how to fix and mitigate the PHP2Shell vulnerability on your server shows how quickly a PHP flaw becomes an urgent patch for every server that runs the affected versions.
How PHP releases are supported
PHP publishes a new minor version, such as 8.4 or 8.5, about once a year. Each version follows the same pattern: about two years of active support, where bugs and security flaws are fixed, followed by about two more years of security support, where only security fixes are released. After that, the version is end of life and receives nothing. A version therefore has roughly four years from release to the end.
The official table is on the supported versions page of php.net, and it is the source to trust, because dates can change. Check it before you plan, and again each year. As a rule of thumb at the time of writing:
- Versions older than 8.2 are already end of life, or close to it, and should not run any public site.
- A version in security-only support is acceptable for a short time, but it is the one to plan to leave.
- A version still in active support is the safe target for a production site today.
Hosting platforms add their own timing. A cPanel host may keep an older version available longer than php.net supports it, so a version being offered on a plan does not mean it is safe. Treat the php.net date as the deadline.
Step 1: Find out what you run
List every site and every PHP version in use, including subdomains, staging copies and old projects that were never turned off. On cPanel, open MultiPHP Manager, as in how to upgrade the PHP version on cPanel. On Plesk, check each website’s PHP Settings, as in how to upgrade PHP on Plesk. On a server, check php -v and every FPM pool:
php -v
ls /etc/php/ 2>/dev/null
systemctl list-units 'php*-fpm*' --no-pager
Expected: a list of versions, some of which you may not have known were running. Put them in a spreadsheet with the site name, the version, the application and its owner.
Step 2: Mark each site by urgency
For each row, compare its version with the support dates and give it one of three labels:
- Urgent: end of life, or within a few months. Upgrade first.
- Soon: in security-only support. Plan the upgrade within the year.
- Current: in active support. Review once a year.
Add a column for how hard the upgrade looks: a small WordPress site with common plugins is easy, a large custom application with abandoned dependencies is hard. Start with the urgent and easy ones, and give the urgent and hard ones a proper project.
Step 3: Choose the target version
The target is the newest version in active support that your software supports. Check three things before you pick it:
- Your platform offers it. A shared host offers only what it has installed, while a VPS can run what you install. If you need a version your host lacks, a VPS gives you the choice.
- Your application supports it. Read the requirements of your framework, CMS and main plugins. WordPress documents the PHP versions it recommends, and Laravel documents its supported versions for each release.
- Your dependencies support it. Composer tells you directly with
composer why-not php 8.4, as shown in how to check your code for PHP compatibility before you upgrade.
If the newest version is not supported yet, choose the one before it, and plan the next step once your software catches up. A newer version is faster and better supported, but a version your plugins cannot run is worse than an older, supported one.
Step 4: Move one minor version at a time
Jumping across several versions at once multiplies the number of changes you must test, and makes a failure hard to trace. If you are on 8.1 and the target is 8.4, move to 8.2, test, then 8.3, test, then 8.4. For each step, repeat the checks, because each version removes different behaviour. For a small site on good plugins this is quick. For a large site it keeps each problem small enough to fix.
Step 5: Use the platform guide, with a copy and a rollback
Each platform has its own procedure, and each has a rollback:
- cPanel: MultiPHP Manager, per domain.
- Plesk: PHP Settings, per website.
- Ubuntu with Nginx and PHP-FPM and Ubuntu with Apache.
- AlmaLinux and Rocky with Remi.
- IIS on Windows with FastCGI.
- Docker containers.
Whichever you use, test on a copy first, take a backup, change one site at a time, and watch the logs for two days. The errors you are likely to see, with fixes, are in how to fix common errors after a PHP upgrade.
Step 6: Put it on the calendar
The upgrade is not a one-time job. Each year a version leaves active support and another leaves security support. Put two dates in a shared calendar: the day your current version leaves active support, and the day it reaches end of life. Set a reminder six months before each. A small yearly upgrade is much cheaper than a rushed one under an advisory.
Write a short runbook for each platform: where the setting is, how to test, how to roll back and who is responsible. When the person who did the last upgrade is not around, the runbook is what makes the next one calm.
Plan for many sites
If you manage many sites, such as an agency or a reseller, work in batches. Group them by platform and by application. Upgrade the least important site in a group first, then the next, and keep a log of problems and their fixes, because the same ones recur. Automate the checks that you can: a script that lists the version of every site, and a script that fetches a few key pages and checks for error text. Keep customers informed with a short note about the planned date and what you tested.
Common mistakes
- Treating “my host offers it” as “it is supported”. Use the php.net dates.
- Forgetting forgotten sites. Old subdomains and staging copies run old versions.
- Jumping several versions. Move one at a time.
- Upgrading after the deadline. A deadline pushed by an incident is the most expensive kind.
- No owner. Without a named person and a calendar date, the upgrade does not happen.
Frequently asked questions
Should I always use the newest PHP version?
Use the newest version in active support that your software supports. The very newest can lack support from plugins in its first months.
How much faster is a newer PHP?
Typical WordPress and Laravel code runs noticeably faster on each recent version, but the size of the gain depends on your code, caching and database. Measure your own pages before and after.
Is it dangerous to run a version in security-only support?
It still receives security fixes, so it is acceptable for a limited time. Plan to leave it before the end date.
What if I cannot upgrade because of an old application?
Isolate it as far as you can, put a firewall or access control in front of it, keep it updated in every other way, and plan its replacement. Running an unsupported version on a public site is a risk you accept knowingly.
Choose the newest PHP version in active support that your software supports, find every version you run, mark each by urgency, move one minor version at a time, and put the support dates in a calendar with an owner. Use the platform guides for the mechanics, and test on a copy each time. For a server where you control the version, read about how to audit a new Ubuntu VPS for security, which fits the same yearly review.
Want this done for you? If you would rather have an engineer plan and carry out the work on your own site, you can hire the author through the Upwork profile of Munaf Sheikh.