What a PHP upgrade involves
PHP 8.2 receives security fixes from php.net only until 31 December 2026, and PHP 8.1 and older receive none, including for the two critical remote-code-execution flaws fixed on 21 October 2026. A safe upgrade audits code and Composer dependencies against the target version, adds tests around critical paths, applies automated fixes with Rector, upgrades the framework, then runs old and new PHP side by side before switching. PHP 8.4 or 8.5 is the sensible target today.
The PHP version is the cheapest thing to fix, until it is the only thing that matters
Most PHP applications that need upgrading still work. That is the problem: nothing forces the decision until a host announces it will stop offering the old version, a penetration test lists it as a critical finding, or a fix arrives only for newer releases. On 21 October 2026 the PHP project shipped 8.2.35, 8.3.36, 8.4.27 and 8.5.12 to close two critical vulnerabilities that can allow unauthenticated remote code execution. Its advisory says PHP 8.1 and older no longer receive updates from the project, and points users to distribution vendors or an upgrade.
This page is about the upgrade job itself: which version to target, how we sequence the work, what breaks between PHP 5 and PHP 8, how Composer dependencies and frameworks complicate it, and what it costs in engineer-days. For general PHP, Laravel and WordPress work, see our PHP & WordPress service. When the application needs re-architecture rather than a new runtime, that is application modernisation, and the section on rebuilding below explains where the line falls.
We upgrade our own software too. CloudMonitor, one of the products we build and run, is on Laravel 13 and PHP 8.3, so framework and runtime upgrades are something we do on our own code before we do them on yours.
PHP support dates: where each version stands
From php.net’s supported versions and unsupported branches pages, checked 13 November 2026. “Active” means bug and security fixes; “security” means security fixes only.
| Version | Active support until | Security fixes until | Status on 13 Nov 2026 |
|---|---|---|---|
| 5.6 | End of life 31 Dec 2018 (last release 5.6.40) | Unsupported for nearly eight years | |
| 7.0 – 7.3 | End of life between 10 Jan 2019 and 6 Dec 2021 | Unsupported | |
| 7.4 | End of life 28 Nov 2022 (last release 7.4.33) | Unsupported | |
| 8.0 | End of life 26 Nov 2023 (last release 8.0.30) | Unsupported | |
| 8.1 | End of life 31 Dec 2025 (last release 8.1.34) | Unsupported | |
| 8.2 | 31 Dec 2024 | 31 Dec 2026 | Security fixes for seven more weeks |
| 8.3 | 31 Dec 2025 | 31 Dec 2027 | Security fixes only |
| 8.4 | 31 Dec 2026 | 31 Dec 2028 | Fully supported |
| 8.5 | 31 Dec 2027 | 31 Dec 2029 | Fully supported |
| 8.6 | Not yet published; release candidate 7 out on 12 Nov 2026, general availability planned for 19 Nov 2026 | Not for production yet | |
If 8.6 follows the current release-cycle policy of two years of active support and two of security fixes, it would be supported until the end of 2030, but treat that as an expectation until php.net publishes the dates.
Your Linux distribution may have its own dates
PHP installed from Debian or Ubuntu packages is patched by the distribution’s security team for the life of that release, which can outlast php.net’s dates: Debian 12 ships PHP 8.2, Debian 13 ships 8.4, Ubuntu 22.04 ships 8.1 and Ubuntu 24.04 ships 8.3. That buys time, not safety forever: fixes depend on the distribution backporting them, Composer packages and frameworks still drop old PHP versions, and the clock runs out when the distribution release does. Check your vendor’s security tracker rather than assuming.
Which version should you upgrade to?
| Target | Choose it when | Watch out for |
|---|---|---|
| PHP 8.3 | A dependency you cannot replace yet does not support 8.4 | Only about 13 months of security fixes left; plan the next hop now |
| PHP 8.4 | The default for most upgrades today; supported by Laravel 11 to 13, CodeIgniter 4.7 and WordPress 6.7 onward | Implicitly nullable parameter types (Type $x = null) now raise deprecation notices across older code |
| PHP 8.5 | Your framework and packages declare support (Laravel 12 and 13, WordPress 6.9 onward) | Backtick shell execution, (integer)-style casts and null array offsets are deprecated |
| PHP 8.6 | Later: after the first few point releases and once your Composer packages declare support | A brand-new branch on day one is a risk with no upside for most businesses |
How we run a PHP upgrade
1. Audit against the target version
Before estimating anything, we measure. Three commands give most of the picture in an afternoon:
# Which installed packages refuse the target PHP version?
composer why-not php 8.4
# Static compatibility scan of your own code (not vendor/)
vendor/bin/phpcs -p src app --standard=PHPCompatibility --runtime-set testVersion 8.4
# Type-level problems, analysed as if running on 8.4 (phpstan.neon: phpVersion: 80400)
vendor/bin/phpstan analyse --level=2 src app
PHPCompatibility aims to cover changes from PHP 5 onward and runs on PHP 7.2 or newer, so on very old servers we run the scans in a container rather than on the box itself. The output, plus a read through bootstrap code, database access and anything that calls the shell, becomes a written list of breaking changes with an estimate for each.
2. Tests where the money is
Legacy code rarely has tests, and we do not write a full suite first. We add end-to-end and HTTP-level tests around the paths that would hurt most if they broke (login, checkout or billing, report exports, scheduled jobs, inbound integrations) and record their current output so the new version can be compared against it.
3. Rector for the mechanical changes
Rector rewrites code automatically. It runs on PHP 7.2 or newer and can read code written for PHP 5. We step through one PHP version set at a time, commit each step separately, and review every diff rather than trusting the tool blindly:
<?php
// rector.php
use Rector\Config\RectorConfig;
return RectorConfig::configure()
->withPaths([__DIR__ . '/app', __DIR__ . '/src'])
->withPhpSets(php84: true); // raise one version at a time on old code
// vendor/bin/rector process --dry-run (review, then run without --dry-run)
Rector handles the repetitive changes well: constructors, nullable types, removed functions with direct replacements, array and string syntax. It does not decide what your code should do when behaviour changed, such as string-to-number comparisons in PHP 8.0. Those need a person and a test.
4. Composer and extensions
Dependencies cause more upgrade delays than your own code. We set the target in composer.json with composer config platform.php 8.4.0, update on a branch with composer update --with-all-dependencies, run composer audit for known vulnerabilities, and deal with what remains: see the risk list below.
5. Staged switch, with a way back
The new version runs alongside the old one: a second PHP-FPM pool or container image with identical code, configuration and extensions. Staging runs with error_reporting = E_ALL and logs every deprecation; then a slice of production traffic or one server moves first, error logs are compared, and the rest follows. Rolling back is a pool or image switch, not a restore. Cron jobs and queue workers move last, because they fail quietly.
What breaks between PHP 5 and PHP 8
| Version | Change that bites legacy code | Usual fix |
|---|---|---|
| 7.0 | mysql_* functions, ereg and the /e modifier of preg_replace removed | PDO or mysqli with prepared statements; preg_*; preg_replace_callback |
| 7.2 | mcrypt removed from core | OpenSSL or sodium, with a plan to re-encrypt stored data |
| 8.0 | each(), create_function(), curly-brace string offsets removed; PHP 4-style constructors no longer run; 0 == "abc" is now false; many internal functions throw errors instead of warnings | Rector for syntax; tests for comparison and error-handling behaviour |
| 8.1 | Passing null to non-nullable internal function parameters deprecated | Usually the largest volume of log noise; fixed at the source, not silenced |
| 8.2 | Dynamic properties deprecated; utf8_encode() and utf8_decode() deprecated | Declare properties or use #[AllowDynamicProperties] as a stop-gap; mb_convert_encoding() |
| 8.4 | Implicitly nullable parameter types deprecated; E_STRICT constant deprecated | Rector adds ?Type; error-handler masks updated |
| 8.5 | Backtick operator, non-canonical casts, semicolon after case, null as an array offset deprecated | Mostly mechanical; Rector sets cover several |
Sources: the PHP manual’s migration guides, including the 8.4 and 8.5 deprecation lists. Deprecations do not stop code running today, but each is a removal waiting in a later major version.
Composer dependency risks to check early
- Abandoned packages. Packagist marks them, and Composer prints a note on install. Each needs a maintained replacement or a fork you are willing to own.
- Locks built with
--ignore-platform-reqs. Acomposer.lockresolved this way can claim compatibility that is not real. We rebuild the lock against the target platform. - Forks and VCS repositories. Patched copies of packages pinned in
repositoriesoften stop receiving upstream fixes and quietly block upgrades. - Code copied into the repository. Libraries pasted into a
lib/folder years ago are invisible to Composer and to vulnerability scanners. - Extensions. PECL extensions and paid encoders or loaders must exist for the target version before anything else is worth doing.
- Private packages. Internal libraries shared across several apps need upgrading first, or all the apps that use them stay stuck.
Framework notes
Laravel
Laravel gives each major release 18 months of bug fixes and two years of security fixes. From the Laravel support table: Laravel 10 (PHP 8.1–8.3) and 11 (PHP 8.2–8.4) are past security support; Laravel 12 supports PHP 8.2–8.5 with security fixes until 24 February 2027; Laravel 13 supports PHP 8.3–8.5 with security fixes into early 2028. We move one major at a time, each released to production before the next starts, and update first-party packages such as Sanctum or Horizon with it.
CodeIgniter
CodeIgniter 4.7.0, released on 1 February 2026, requires PHP 8.2 or newer. CodeIgniter 3 is a different story: there is no official CodeIgniter 3 release built for PHP 8.2 and later, and community forks fill the gap. Because CodeIgniter 4 is a ground-up rewrite with a different structure, moving a large CodeIgniter 3 app to it is closer to a framework migration than an upgrade. The audit compares a fork, a move to CodeIgniter 4, and a move to Laravel on cost and risk.
WordPress
The WordPress compatibility table shows WordPress 7.0 and 7.1 need PHP 7.4 or newer and support up to 8.5; 6.9 supports 7.2 to 8.5. Core is rarely the blocker. Custom themes, in-house plugins and abandoned third-party plugins are, so we test each one on a staging copy with debug logging on before the host switch.
PHP upgrade cost: effort bands by codebase size
Our planning ranges in engineer-days, for your own code (excluding vendor/), moving to PHP 8.4. They include audit, tests on critical paths, the upgrade itself and the staged switch. They are not a quote; the audit produces one.
| Codebase | From PHP 8.1 / 8.2 | From PHP 7.x | From PHP 5.x |
|---|---|---|---|
| Small (up to ~20k lines, current framework) | 2 – 5 | 5 – 12 | 10 – 25 |
| Medium (20k – 100k lines, framework one or two majors behind) | 5 – 12 | 12 – 35 | 25 – 60 |
| Large (100k+ lines, custom framework or CodeIgniter 3, few tests) | 10 – 25 | 30 – 80 | Audit first; often a partial rebuild |
| WordPress site with custom theme and plugins | 1 – 3 | 3 – 8 | 6 – 15 |
What pushes a job to the top of its band: no version control history, encoded or obfuscated files, several apps sharing one database or library, and integrations that cannot be tested outside production. The audit itself is usually 2 to 5 engineer-days.
What staying put costs
Some hosts now charge to keep old PHP running. IONOS’s US PHP Extended Support page lists monthly fees of $23.58 for PHP 5.2 to 5.6, $18.28 for 7.0 to 7.3, $15.62 for 7.4 and 8.0, and $7.81 for 8.1 (checked 13 November 2026). Commercial long-term-support builds from vendors such as Zend and TuxCare are priced on request. These can be a sensible bridge for a few months; they are not a plan, because frameworks and Composer packages keep moving on.
Upgrade or rebuild?
| Signal | Points to upgrading | Points to rebuilding |
|---|---|---|
| Business rules | Still correct and mostly stable | Changed so much that half the code is workarounds |
| Structure | A framework, even an old one, with some separation of concerns | SQL, HTML and logic mixed in every file with no pattern to follow |
| Audit estimate | Upgrade effort well below a rebuild estimate | Upgrade effort approaches the cost of rebuilding the parts you actually use |
| Usage | Most screens and reports are still used | A small core is used; the rest could be retired |
| Team | Your developers can maintain it once upgraded | Nobody will maintain this code base whatever version it runs on |
Often the answer is both: upgrade now to get onto a supported runtime within weeks, then replace the worst modules one at a time. That second part is modernisation work, and it is easier on a supported PHP version.
Typical PHP upgrade jobs
Common starting points and how the work usually goes.
| Starting point | Main work | How it usually goes |
|---|---|---|
PHP 5.6 custom app using mysql_* | Database layer moved to PDO or mysqli, removed functions replaced, Composer introduced | Biggest jump; tests around login, billing and reports first, then Rector sets one version at a time |
| PHP 7.4 with Laravel 6 to 8 | Framework climbed one major at a time to 12 or 13, PHP raised alongside | Each Laravel major is a small release of its own, deployed before the next starts |
| CodeIgniter 3 on PHP 7.x | Decide between a maintained community fork and a move to CodeIgniter 4 or Laravel | The decision comes from the audit; a framework move is closer to a partial rewrite |
| PHP 8.1 or 8.2 on Laravel 10 or 11 | PHP to 8.4, Laravel to 12 or 13, dependencies refreshed | Usually the shortest job; most effort goes into third-party packages |
| WordPress with in-house plugins | Custom plugins and theme made compatible, abandoned plugins replaced | Tested on a staging copy with full error logging before the host switch |
PHP upgrade services
Four pieces of work. The audit stands on its own; you can take its findings to any team.
Upgrade audit
The problem
You know the PHP version is old, but not how much breaks, which packages block the move or what it will cost.
How we do it
Compatibility and static scans against the target version, a Composer dependency review, a read of the risky areas, and a written list of breaking changes with an engineer-day estimate and a recommended target.
What you get
- Breaking-change list by file and severity
- Dependency blockers with replacements
- Target version recommendation
- Estimate, plus upgrade-or-rebuild view
Safety-net tests
The problem
There are no tests, and the code that matters most is the code nobody understands.
How we do it
End-to-end and HTTP-level tests around login, payments, reports, scheduled jobs and integrations, recording today’s behaviour so the upgraded version can be compared with it.
What you get
- Tests on revenue-critical paths
- Recorded baseline outputs
- CI job that runs on both PHP versions
- Notes on behaviour that surprised us
The upgrade
The problem
Thousands of deprecations, removed functions, stale packages and a framework several majors behind.
How we do it
Rector one version set at a time with every diff reviewed, manual fixes where behaviour changed, Composer updated against the target platform, and framework majors climbed in order.
What you get
- Small reviewed commits per step
- Composer lock rebuilt for the target
- Framework on a supported major
- Deprecation log cleared or documented
Staged switch and hosting
The problem
The host, Docker image or server build is as old as the code, and a failed switch would mean downtime.
How we do it
A second PHP-FPM pool or container image on the target version, traffic moved in steps with error logs compared, cron and queue workers last, and a rollback that is one switch.
What you get
- Side-by-side runtime
- Stepwise cutover plan
- Rollback tested before go-live
- Updated server or image build in code
Tools we use for PHP upgrades
Open-source tools, run in your repository and CI so you keep using them afterwards.
Rector
Automated, reviewable rewrites for each PHP version set and many framework upgrades.
PHPStan and PHPCompatibility
Type-level analysis against the target version and a scan for removed or changed features.
Composer
Platform-pinned resolution, why-not checks for blockers, and audit for known vulnerabilities.
PHPUnit, Pest and HTTP tests
Behaviour pinned on critical paths, run against old and new PHP in the same pipeline.
PHP-FPM pools and container images
Old and new versions side by side, so switching back is instant.
Laravel, CodeIgniter, WordPress
Upgrade guides followed one major at a time, with first-party packages kept in step.
Tools we use alongside it
- Rector
- PHPStan
- PHP_CodeSniffer
- PHPCompatibility
- Composer audit
- PHPUnit
- Pest
- Docker
- GitHub Actions
- Sentry
Facts, versions and vendor details checked 13 November 2026.
How a PHP upgrade starts
Remote, in your repository and a staging copy of your environment.
A free 30-minute call
Current PHP and framework versions, hosting, rough codebase size and the deadline driving you. We say whether an audit is worth it.
Audit
Read access to the repository and a staging copy. You get the breaking-change list, the blockers and an estimate in engineer-days.
Tests and upgrade
Safety-net tests first, then the upgrade in small reviewed steps, each deployable to staging.
Staged switch
Side-by-side runtime, stepwise cutover, rollback ready. Then handover, or ongoing care if you want it.
PHP software we run ourselves
We keep our own Laravel products on supported versions, which is where most of our upgrade habits come from.
Guides and related pages
Questions about PHP upgrades
PHP 8.2 receives security fixes from php.net until 31 December 2026; active bug-fix support ended on 31 December 2024. After that date the PHP project releases no further fixes for 8.2, although Linux distributions that ship it, such as Debian 12, may keep backporting security patches for their own packages.
For most applications today, PHP 8.4, which has security support until 31 December 2028, or PHP 8.5, supported until 31 December 2029, if your framework and Composer packages already support it. PHP 8.6 is planned for 19 November 2026 and is better adopted after a few point releases.
It depends on size and structure more than on the version gap. As planning ranges, we see about 10 to 25 engineer-days for a small PHP 5 application and 25 to 60 for a medium one, including tests and a staged switch. Large PHP 5 systems need an audit first, and some are cheaper to partly rebuild.
Partly. Rector runs on PHP 7.2 or newer, can read PHP 5 code and handles many mechanical changes such as constructors, removed functions with direct replacements and type syntax. It cannot decide what code should do where PHP behaviour changed, such as string-to-number comparison in PHP 8.0, so every diff needs review and tests.
It should not. We run the old and new PHP versions side by side as separate PHP-FPM pools or container images, move traffic in steps while comparing error logs, and keep the old runtime ready so switching back takes minutes. Cron jobs and queue workers move last.
Usually yes, because older framework versions do not support newer PHP. Laravel 12 supports PHP 8.2 to 8.5 and Laravel 13 supports 8.3 to 8.5. CodeIgniter 4.7 needs PHP 8.2 or newer, while CodeIgniter 3 has no official release built for PHP 8.2 and later, so CodeIgniter 3 apps need a fork or a framework move.
It can be a short bridge, not a plan. The PHP project no longer releases fixes for 8.1 and older, so you depend on the host or vendor backporting each fix, and frameworks and Composer packages keep dropping old versions. Some hosts also charge monthly fees for old versions.
Upgrade when the business rules are still right, the code has some structure and the upgrade estimate is well below a rebuild. Rebuild, usually in parts, when most code is workarounds, only a small core is used, or nobody will maintain the code base. Often the best route is to upgrade first, then replace weak modules gradually.
Running PHP 8.2 or older?
Tell us the PHP and framework versions, roughly how large the codebase is, where it is hosted and what deadline you are facing. A senior engineer will reply with a first view of the effort and whether an audit is worth doing.






Compliance-first delivery