PHP 8.2 receives security fixes from php.net until 31 December 2026, 37 days from the date of this guide. After its last release the branch is unsupported, and php.net publishes no more fixes for it. Upgrade to a supported branch before then: PHP 8.5 for most applications, or PHP 8.4 if a dependency does not yet support 8.5. Check the dates on our PHP 8.2 support page and the PHP version tracker.
When does PHP 8.2 reach end of life?
PHP 8.2 was released on 8 December 2022. php.net's supported versions page lists active support until 31 December 2024 and security support until 31 December 2026. Security support means "critical security issues only", and php.net says releases in that period are made "on an as-needed basis": there may be several point releases, or none.
The branches around it, from the same page:
| Branch | Released | Active support until | Security support until |
|---|---|---|---|
| 8.2 | 8 Dec 2022 | 31 Dec 2024 | 31 Dec 2026 |
| 8.3 | 23 Nov 2023 | 31 Dec 2025 | 31 Dec 2027 |
| 8.4 | 21 Nov 2024 | 31 Dec 2026 | 31 Dec 2028 |
| 8.5 | 20 Nov 2025 | 31 Dec 2027 | 31 Dec 2029 |
| 8.6 | 19 Nov 2026 | 31 Dec 2028 | 31 Dec 2030 |
Our October 2026 PHP2Shell fix guide shows the kind of release the branch can still receive today: upstream PHP 8.2.35. Install the newest 8.2 patch release now, and treat it as a bridge, not a destination.
What changes after PHP 8.2 reaches end of life?
PHP does not stop working. The change is that php.net stops fixing it. Its end-of-life page lists unsupported branches and urges anyone on them to upgrade, because older versions "may expose you to security vulnerabilities and bugs that have been fixed in more recent versions of PHP." Every later vulnerability that affects 8.2 will be fixed in 8.3 and newer, and not in the 8.2 sources.
Some vendors keep patching a PHP they ship. These policies are published, and they cover specific packages, not "PHP 8.2" everywhere:
- Debian backports fixes instead of moving to a new upstream version: its security FAQ says "we backport security fixes to the version that was shipped in the stable release". Debian 12 (bookworm) ships
php8.2, as the Debian security tracker shows. Debian's release page lists Debian 12 as oldstable under LTS support, with an end of LTS of 30 June 2028. - Red Hat Enterprise Linux 9 lists a PHP 8.2 application stream retiring in May 2029 on its application streams life cycle page. Red Hat's backporting policy says "for most products, our default practice is to backport security fixes" and that the upstream version number does not show whether a package is vulnerable.
- Ubuntu: the October 2026 notice USN-8948-1 lists fixed
php8.1,php8.3andphp8.5packages and does not mention 8.2. If an Ubuntu server runs 8.2, find out which repository supplies it (apt policy php8.2-fpm) and ask that repository's maintainer about its plans.
A backport is a vendor's decision, per CVE, for one package. It protects you only while the vendor covers your exact package, and a scanner that compares upstream version numbers will still flag the host. See Ubuntu's CVE tracker and the PHP2Shell guide for how to read a package revision.
Which PHP version should you upgrade to?
Every supported branch gets security fixes, so choose by runway and by what your stack supports. Our recommendation:
- PHP 8.5 for most applications. It is the newest branch that Laravel 12 and 13 both list, and php.net lists security support until 31 December 2029. The 8.5 upgrade checklist covers the final hop.
- PHP 8.4 if a package, extension or host blocks 8.5. Its active support ends on 31 December 2026, and security support runs to 31 December 2028, so it buys two years.
- PHP 8.3 only as a stopover. Security support ends 31 December 2027, so you would upgrade again within a year.
- PHP 8.6 once your framework, extensions and hosting list it. It was released on 19 November 2026, per its release announcement, and it brings secure session defaults and deprecations that need testing.
How do you check which PHP version serves your site?
The php in your terminal is not necessarily the PHP that answers web requests: a server can run several versions side by side, and FPM pools, cron jobs and queue workers can each use another binary. Check each one.
php -v
php --ini
composer show --platform
composer check-platform-reqs --lock
php -v prints the SAPI and version of the CLI binary. Composer's check-platform-reqs checks the real platform against the requirements of your packages and ignores config.platform; --lock reads the lock file instead of installed packages. These commands see the CLI only.
For the web, use the PHP_VERSION and PHP_SAPI constants from inside the application, behind authentication:
<?php
// Temporary diagnostic route: protect it, then delete it.
header('Content-Type: text/plain');
echo PHP_VERSION, ' ', PHP_SAPI, PHP_EOL;
phpinfo() also reports the version, but its output includes environment variables and predefined variables, so never leave it reachable on a public site. For WordPress, follow our PHP version check.
What are the steps to upgrade from PHP 8.2?
- Inventory. List every place PHP runs: web pools, CLI jobs, queue workers, containers, CI. Record
php -vandphp -mfor each. - Find blockers in Composer. Run
composer why-not php 8.5(theprohibits/why-notcommand lists the packages that block a version; add-rto follow the chain). Update or replace each blocker, then runcomposer check-platform-reqson the target runtime. If yourcomposer.jsonsetsconfig.platform, Composer warns that a faked platform lets an install succeed that "will fail at runtime", so update or remove it and raiserequire.phpwhen you are done. - Match extensions. Install the same extensions for the new version and compare
php -moutput. Note that PHP 8.5 always loads Opcache, andzend_extension=opcachenow emits a warning, per its incompatible changes. - Read the migration guides. Each hop has a page on php.net; read all the ones you skip.
| Hop | What to look for |
|---|---|
| 8.2 to 8.3 | range() now throws TypeError and ValueError in more cases and treats string digit boundaries differently. A negative index on an empty array changes the next key. Date errors use DateError and DateException. assert.* INI settings, and ++ on non-alphanumeric strings, are deprecated. |
| 8.3 to 8.4 | Implicitly nullable parameters (T $a = null) are deprecated, as is omitting the escape argument of fputcsv(), fgetcsv() and str_getcsv(). E_STRICT is removed. JIT now defaults to opcache.jit=disable. |
| 8.4 to 8.5 | Casts (boolean), (integer), (double) and (binary), the backtick operator and null as an array offset are deprecated, and driver constants such as PDO::MYSQL_ATTR_* move to Pdo\Mysql. Opcache is always built in. |
| 8.5 to 8.6 | trim() also strips form feed by default. Sessions default to use_strict_mode=1, cookie_httponly=1 and cookie_samesite="Lax". return inside finally, spl_object_hash() and the mbregex functions are deprecated. |
- Test with deprecations visible. Run your test suite on the target version with
error_reportingset toE_ALL, fix warnings in your own code, and log upstream ones. A green Composer install does not prove behavior: exercise login, payments, uploads, background jobs and scheduled tasks. - Roll out in stages. Deploy to staging, then to one instance or pool, watch error logs and queue workers, then the rest. Restart FPM and workers so no old process keeps serving, and keep the previous image or package for rollback. The 8.5 checklist has an acceptance table you can reuse.
Which framework versions support which PHP?
Moving PHP and moving your framework are two clocks. From the Laravel support policy and the Symfony release pages:
| Framework | PHP versions | Security fixes until |
|---|---|---|
| Laravel 11 | 8.2 to 8.4 | 12 March 2026 |
| Laravel 12 | 8.2 to 8.5 | 24 February 2027 |
| Laravel 13 | 8.3 to 8.5 | 17 March 2028 |
| Symfony 6.4 LTS | 8.1.0 or higher | November 2027 |
| Symfony 7.4 LTS | 8.2.0 or higher | November 2029 |
| Symfony 8.1 | 8.4.0 or higher | January 2027 |
Laravel 12 runs on 8.2 through 8.5, so you can upgrade PHP first without touching the framework, but Laravel 13 needs 8.3 or newer. Laravel 11 no longer gets security fixes, so the PHP upgrade alone does not make it safe. Symfony 7.4 LTS requires PHP 8.2.0 or higher, so it supports a PHP upgrade without a framework change. Laravel's table does not list 8.6 for any release, so check before you pick it.
What about hosting and containers?
For Docker, the official php image publishes tags for 8.2 through 8.6 with cli, apache and fpm variants on Debian and Alpine bases, for example php:8.5-fpm and php:8.5-fpm-trixie. A tag for 8.2 existing today does not make the branch supported: check php.net's table above. Change the tag in your Dockerfile, rebuild, and roll the new image to every instance; pulling an image does not replace running containers.
On managed hosting, find the PHP setting in your control panel, but also confirm what your provider promises for after 31 December 2026. We could not verify any provider's policy, so ask yours directly. The PHP2Shell patch guide lists what to ask a host.
If your application cannot move yet, read the legacy PHP mitigation guide for temporary controls. They reduce exposure; they do not replace a supported runtime.
Verified against php.net, Composer, Debian, Red Hat, Ubuntu, Laravel, Symfony and Docker documentation on 24 November 2026. Support dates and vendor policies change, so check each source before acting.