PHP 8.2 end of support: upgrade a SaaS without downtime
PHP 8.2 security support ends Dec 31, 2026. Compare 8.3–8.6, gate images with check-platform-reqs, and roll out web and workers safely.
This article is for informational and educational purposes only. It is not a security audit, a penetration test or a promise that your systems are free of vulnerabilities or defects. Versions, fixes and dates are current as of the date shown above. Check your vendor's and your distribution's advisories before you act. Any change you apply is your responsibility. No exploit code is provided. Only test systems you own or are authorised to test.
PHP 8.2 upstream security support ends on December 31, 2026. Your app will not stop running overnight, but the PHP project stops issuing security fixes for 8.2. Pick a supported target (8.3 through Dec 2027, 8.4 through Dec 2028, 8.5 through Dec 2029, or 8.6, shipped November 19, 2026, through Dec 2030), verify every final web and worker image with composer check-platform-reqs --no-dev, and decouple PHP upgrades from incompatible schema or queue changes.

A PHP upgrade is not finished when the new container starts. It is finished when the web runtime handles the requests that matter, workers can process messages that were already in flight, and operators can stop the rollout without stranding customer data. For a small SaaS team, the hard part is rarely changing a Dockerfile. It is catching the dependency, second runtime, or irreversible data change that the Dockerfile does not reveal.
The PHP support calendar puts PHP 8.2's upstream security end date at December 31, 2026. Your application will not switch off the next day. What ends is the PHP project's security coverage for that branch. A hosting provider or Linux distributor may maintain an exact package on a different schedule. Ask for written scope, dates, and evidence; do not assume that coverage extends to another image or a PHP binary you built yourself.
Choose a branch you can actually operate
PHP 8.6 shipped on November 19, 2026. It is an option, not an automatic target. Compare branches your provider can maintain, your dependencies and extensions can run, and your team can deploy and observe reliably. These are the upstream security dates, not a promise about any hosting plan:
- PHP 8.3 (upstream security support through December 31, 2027) — A bridge when a confirmed blocker prevents a longer-lived move. Assign an owner and an exit date.
- PHP 8.4 (upstream security support through December 31, 2028) — Your framework, extensions, or host already support it and that exact combination passes your checks. Active support ends on December 31, 2026.
- PHP 8.5 (upstream security support through December 31, 2029) — The critical ecosystem supports it and the evidence is comparable to 8.4.
- PHP 8.6 (upstream security support through December 31, 2030) — Vendor, package, and extension compatibility are confirmed. Do not choose it on the date alone.
Build the inventory by service and execution mode, not by repository. Include the web server, queue workers, scheduled jobs, administrative tools, and any second FPM pool. For each, record the image digest, PHP version and SAPI, package source, loaded INI and extensions, locked dependencies, and owning team. Verify what the deployed process actually runs: typing php in a shell does not tell you what handles an HTTP request. If you are crossing several versions, read the PHP migration guides for the intermediate releases as well as the target.
Gate the artifact you will deploy
Composer can resolve dependencies against a simulated platform. config.platform can pin the PHP version or represent extensions during dependency resolution. That setting helps keep resolution intentional, but it does not install extensions or show that the final image loads them. The image that builds the dependencies may not even be the image that serves production.
In CI, check each final candidate image, both web and worker, with its installed production dependencies, from the application directory. Make a verified Composer binary available for that check; there is no need to keep it in the running service. Inside that candidate environment, run:
php -v
php --ini
php -m
composer check-platform-reqs --no-devcheck-platform-reqs uses the real PHP and extensions of that process rather than the simulated values in config.platform. Treat a nonzero exit as a promotion failure, not a reason to skip requirements. Capture the output, result, and candidate digest together. If the application needs an extension that no package declares, declare it or add an explicit check. Remember what passed: this is a CLI test. FPM can load different settings even in the same container. A request through the actual web runtime is still required.
Run that check with the production packages installed in vendor/. --lock can check what composer.lock declares, but does not prove the image contains those packages.
Build a negative control to catch a bad image at the gate
In this lab, Composer installs the same local package in both images. The package requires ext-intl; config.platform simulates that extension during dependency resolution but does not install it. Both builds succeed. Checking the final artifact exposes the difference.
Create these four files in a disposable directory (Dockerfile, composer.json, fixture/composer.json, and probe.php). The test server listens only inside the container; it publishes no ports and does not touch a real queue.
FROM composer:2.11.2 AS composer
FROM php:8.4.28-cli-bookworm AS candidate
COPY --from=composer /usr/bin/composer /usr/local/bin/composer
WORKDIR /app
COPY composer.json probe.php ./
COPY fixture ./fixture
RUN composer install --no-dev --no-interaction --no-plugins --no-scripts --no-progress
FROM candidate AS without-intl
FROM candidate AS with-intl
RUN apt-get update && apt-get install -y --no-install-recommends libicu-dev \
&& docker-php-ext-install intl && rm -rf /var/lib/apt/lists/*{"name":"example/intl-probe","require":{"php":"^8.4","example/currency":"1.0.0"},"repositories":[{"type":"path","url":"fixture","options":{"symlink":false}},{"packagist.org":false}],"config":{"platform":{"ext-intl":"8.4.0"}}}{"name":"example/currency","version":"1.0.0","require":{"ext-intl":"*"}}<?php
declare(strict_types=1);
$mode = PHP_SAPI === 'cli-server' ? 'web' : 'worker';
$event = json_decode('{"amount":12.5,"currency":"EUR"}', true, 512, JSON_THROW_ON_ERROR);
if (!extension_loaded('intl')) {
if ($mode === 'web') http_response_code(500);
echo "intl-missing\n";
exit(78);
}
$formatted = (new NumberFormatter('en_IE', NumberFormatter::CURRENCY))
->formatCurrency($event['amount'], $event['currency']);
if ($formatted === false) throw new RuntimeException('format failed');
echo "$mode:intl-ok\n";for variant in without with; do
image="php-intl-lab:$variant"
docker build --target "$variant-intl" -t "$image" . || break
docker run --rm --network none "$image" composer check-platform-reqs --no-dev
printf 'composer_exit=%s\n' "$?"
docker run --rm --network none "$image" php probe.php
printf 'worker_exit=%s\n' "$?"
docker run --rm --network none "$image" sh -c '
php -S 127.0.0.1:8080 probe.php >/tmp/web.log 2>&1 &
sleep 1
php -r '\''$ctx=stream_context_create(["http"=>["ignore_errors"=>true]]);
echo file_get_contents("http://127.0.0.1:8080/", false, $ctx);
echo $http_response_header[0], PHP_EOL;'\''
'
doneAuthor-observed run on Linux arm64 with PHP 8.4.28 and Composer 2.11.2 (note: floating composer:2 now resolves to 2.11.3, so pinning composer:2.11.2 keeps the run reproducible): without the extension, Composer reported missing ext-intl (exit 2), the request returned HTTP 500 with intl-missing, and the test worker exited 78. With it, Composer and the worker exited 0 and HTTP returned 200 with web:intl-ok. The probe formats a synthetic amount using NumberFormatter. This checks the negative control against installed packages in vendor/; it does not replace a smoke test against your FPM or a test of your actual queue.
Design for old and new processes to coexist
During a staged rollout, expect old code to read data written by new code. Keep the PHP upgrade separate from changes to schemas or message formats when possible. If a schema change is necessary, expand first: add optional fields, accept both formats, and verify that old code can read new writes. Backfill with monitoring. Remove the old fields in a later release, after the rollback window has closed.
For queues, test old producer with new consumer and the reverse where those combinations are possible. Include a duplicate delivery or retry and use a simulated payment system if the path involves money. Verify idempotency and the intended failed-job behavior. A worker that starts successfully may still be unable to read an existing payload. An HTTP health endpoint does not test checkout, an authenticated session, or a scheduled task. Pick one smoke test for each critical business path and compare the result with the current release.
Decide what earns a wider rollout
Start with synthetic traffic and use a small production cohort only after staging passes. Bound worker exposure too; isolate a queue if production jobs cannot otherwise be split safely. Compare error rates, latency, critical-path success, oldest queued job, retries, and terminal failures by version. A traffic percentage alone is not a success criterion. Agree on a minimum count of representative operations and a window that includes the relevant scheduled job. At low volume, silence is inconclusive:
- Advance — Deployed digests match the evidence, both web and workers behave as expected, and the agreed metrics stay within limits.
- Hold — A critical path has no test coverage, messages are stuck, or results cannot be attributed to a version. Do not use a larger rollout to resolve missing evidence.
- Roll back or fix forward — A critical operation breaks or a pre-agreed limit is crossed. Revert only to an artifact that is still acceptable from a security standpoint and can read state written by the candidate. If the old branch is unsupported or the old code cannot read the new state, isolate the affected flow and use the rehearsed recovery path rather than swapping an image tag and hoping.
For a founder, the deliverable is a one-page decision: target branch and why, remaining blockers, PHP 8.2 exit date, change window, who can stop the rollout, and what safe recovery looks like. Operators attach the digests, web and worker evidence, and thresholds. The end-of-support date tells you why to make the change; that evidence tells you when to widen it.
Frequently asked questions
- Does my PHP 8.2 application stop running on January 1, 2027? No. It keeps running, but upstream security coverage from the PHP project ends on December 31, 2026. If a host or distro promises extended maintenance, ask for exact package scope, dates, and evidence in writing.
- Should a SaaS jump straight from PHP 8.2 to PHP 8.6? Only when hosting, packages, and extensions are verified on 8.6. PHP 8.6 shipped on November 19, 2026 with security support through December 31, 2030, while 8.4 and 8.5 often have broader ecosystem readiness today.
- Why is config.platform in composer.json not enough to prove a container works? Because config.platform only simulates PHP versions or extensions during dependency resolution. Run composer check-platform-reqs --no-dev inside the final candidate image with vendor/ installed, then verify FPM and workers separately.
- Can we safely roll back to PHP 8.2 if a canary fails? Only if the previous image remains acceptable from a security standpoint and can still read data or queued messages written by the new branch. Otherwise, isolate the broken path and recover forward.
Related reading
- How to verify which PHP version live workers actually execute
- Why public bodies took PHP websites offline during the 2026 alert
- “Progressive Shutdown”: How Spanish Regional Governments Responded to the 2026 PHP Alert
Sources
Let an agent prepare this. Your team approves it.
An agent can track advisories, check them against your versions and prepare the update for your team to review and apply. We design that workflow: scoped permissions, human approval before any change, and a log of every step. We do not audit or patch your systems.


