Debian 13 trixie, Debian 12 bookworm and Debian 11
How to update PHP on Debian
Debian delivers its PHP2Shell fixes through the security archive: DSA-6574-1 for Debian 13 and DLA-4848-1, from the LTS team, for Debian 12, both on 21 October 2026. A server only receives them if its APT sources list the security suite. Upgrade, restart PHP-FPM or Apache, then confirm against the security tracker.
Last reviewed against the Debian security tracker, Debian's advisories, packages.sury.org and php.net.
Debian tracker read 27 October 2026
Where Debian's fixed PHP lives
Debian's tracker shows two builds of PHP for each supported release. The one in the main archive is still marked vulnerable; the fixed one sits in the security suite. Both CVEs have the same fixed version on each row.
| Release | Package | Main archive (vulnerable) | Security archive (fixed) | Advisory |
|---|---|---|---|---|
| Debian 13 (trixie), stable | php8.4 | 8.4.24-1~deb13u1 | 8.4.27-1~deb13u1 | DSA-6574-1 |
| Debian 12 (bookworm), LTS | php8.2 | 8.2.32-1~deb12u1 | 8.2.35-1~deb12u1 | DLA-4848-1 |
Debian testing (forky) and unstable (sid) carry php8.4
8.4.27-1, listed as fixed. Debian 11
has no row: see below.
This time the numbers line up
The trixie changelog for DSA-6574-1 opens with "New upstream version 8.4.27" and then names both CVEs. Debian 12's update likewise moved php8.2 to 8.2.35. So on Debian, unlike Ubuntu, the part before the hyphen matches the release the PHP project shipped on 21 October 2026.
What the tilde in ~deb13u1 means
Debian's version rules make a tilde sort before anything else,
so 8.4.27-1~deb13u1 counts as
slightly lower than unstable's 8.4.27-1.
The lower sort order says nothing about the fix: Debian's
tracker marks both builds as fixed.
Primary sources: tracker for CVE-2026-109618, tracker for CVE-2026-109619, DSA-6574-1 and DLA-4848-1. Upstream fixed releases: PHP2Shell, CVE-2026-109618 and CVE-2026-109619.
The update, in order
Update PHP on Debian in five steps
Commands are shown for Debian 13 and PHP 8.4. On Debian 12, read
8.2 for
8.4 and
bookworm for
trixie.
-
Make sure the security suite is in your APT sources
grep -rn security /etc/apt/sources.list /etc/apt/sources.list.d/Without it the server can only see the vulnerable build in the table. Since Debian 13 the recommended layout is the deb822 format in
/etc/apt/sources.list.d/debian.sources; the Debian Reference shows the security entry as:Types: deb deb-src URIs: http://security.debian.org/debian-security/ Suites: trixie-security Components: main non-free-firmware contrib non-freeOlder servers use the one-line format in
/etc/apt/sources.list. The Debian wiki's bookworm example is:deb https://security.debian.org/debian-security bookworm-security main non-free-firmware -
Refresh the lists and see what is waiting
sudo apt update apt list --upgradeable apt-cache policy php8.4-fpmapt list --upgradeableshould now include the PHP packages.apt-cache policyshows each available version with its priority and archive; the fixed8.4.27-1~deb13u1should be offered from the security archive. -
Install the fixed packages
sudo apt upgrade # Or move only the PHP packages that are installed sudo apt-get install --only-upgrade php8.4-cli php8.4-fpm libapache2-mod-php8.4A plain upgrade is what Debian's security FAQ describes: update the package lists, then upgrade. The second form leaves every other package where it is and will not add a PHP package that is not already there.
-
Check the version and the changelog
dpkg-query -W 'php8.4*' apt-get changelog php8.4-fpm | head -n 6These are the two tests Debian's security team suggests: the exact version against the advisory, or the changelog entry for the fix. On a fixed Debian 13 server the changelog starts:
php8.4 (8.4.27-1~deb13u1) trixie-security; urgency=high * New upstream version 8.4.27 + (CVE-2026-109618, CVE-2026-109619): Avoid state corruption via bailout. -
Restart PHP and anything else using it
sudo systemctl restart php8.4-fpm # php8.2-fpm on Debian 12 sudo systemctl restart apache2 # if PHP runs as mod_php sudo apt install debian-goodies # provides checkrestart sudo checkrestart # lists anything else still on old codeDebian's FAQ points to
checkrestart, in the debian-goodies package, for finding services still running replaced code; the needrestart package does a similar job. For the details of PHP-FPM pools and Apache handlers, see the PHP-FPM guide and PHP on Apache.
Release by release
What your Debian release means for PHP2Shell
Not sure which release a server runs?
lsb_release -sc prints its codename
once the lsb-release package is installed.
Debian 13 (trixie)
The current stable release, on PHP 8.4. Debian's security team fixed it in DSA-6574-1 by moving the package to the 8.4.27 upstream release, so the php.net number and Debian's agree.
Step-by-step update
Debian 12 (bookworm)
On PHP 8.2, and looked after by the Debian LTS team since 11 June 2026. Its fix is DLA-4848-1, which takes PHP to 8.2.35. Updates arrive through the same security archive as before.
What LTS changes
Debian 11 (bullseye)
On PHP 7.4. Its LTS period ended on 31 August 2026, and Debian's tracker pages for both CVEs list no bullseye package, so Debian itself will not ship a fix.
Options for Debian 11
packages.sury.org
Ondřej Surý's repository of PHP builds for Debian, used when a server needs a branch Debian does not ship. Fixed builds for every branch from 7.4 to 8.5 went up on 21 October 2026.
Using packages.sury.orgDebian LTS
Debian 12 under LTS, and Debian 11 after it
When Debian's security team finishes with a release, a separate LTS team keeps patching it and publishes Debian LTS Advisories (DLAs) instead of DSAs. Debian 12's LTS period runs from 11 June 2026 to 30 June 2028.
Nothing needs to change on the server: the LTS wiki states that a system already following security.debian.org gets LTS updates automatically. What does change is coverage. The wiki says the number of fully supported packages depends on the backing the LTS team receives, and recommends the debian-security-support package, which warns about unsupported packages whenever you install something and can be run by hand:
sudo apt install debian-security-support
check-support-status Debian 11 (bullseye): no fix from Debian
Bullseye's LTS period ran from 15 August 2024 to 31 August 2026, so PHP2Shell arrived after it closed, and neither CVE's tracker page has a bullseye entry. Its PHP 7.4 has also been out of the PHP project's support since 28 November 2022. The lasting answer is an upgrade to Debian 12 or 13. As a stopgap, packages.sury.org publishes bullseye builds of every branch from 7.4 to 8.5, dated 21 October 2026. If neither can happen soon, weigh taking the site offline.
Other PHP branches on Debian
Using packages.sury.org on Debian
Debian ships one PHP branch per release. Servers that need another one, PHP 8.3 on Debian 13 for example, usually get it from packages.sury.org, which its maintainer describes as the main PHP repository for Debian. Several branches can be installed side by side.
The two are closely linked: the changelog entry for Debian 13's own php8.4 security update carries Ondřej Surý's name, and he also runs packages.sury.org. The repository's README sets it up with these steps:
sudo apt-get install lsb-release ca-certificates curl
sudo curl -sSLo /tmp/debsuryorg-archive-keyring.deb https://packages.sury.org/debsuryorg-archive-keyring.deb
sudo dpkg -i /tmp/debsuryorg-archive-keyring.deb
echo "deb [signed-by=/usr/share/keyrings/debsuryorg-archive-keyring.gpg] https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/php.list
sudo apt-get update
After that, the update is the same apt update
and apt upgrade as in the steps
above. On 27 October 2026 its trixie, bookworm and bullseye indexes
held 8.2.35, 8.3.36, 8.4.27 and 8.5.12, all built on 21 October
2026, which are the PHP project's fixed releases.
It takes over your branch.
A build such as 8.4.27-1+0~20261021.57+debian13~1.gbp7636b9
sorts above Debian's 8.4.27-1~deb13u1.
APT installs the higher version when two have the same priority,
so once the repository is added it supplies that branch unless
you pin Debian's packages.
Older branches were rebuilt too.
New PHP 7.4, 8.0 and 8.1 builds appeared on the same day. Its
8.1.34-9 build records the two CVE fixes as backported from a newer
branch; for whichever old branch you run, confirm the same with
apt-get changelog.
Confirm it worked
Evidence that a Debian server is fixed
- 1. The packages match the advisory.
Every php8.4 package shows
8.4.27-1~deb13u1or later (php8.2 at8.2.35-1~deb12u1on Debian 12), or the packages.sury.org equivalent. - 2. The changelog names CVE-2026-109618 and CVE-2026-109619. Keep the output; it settles arguments with tools that only read version numbers.
- 3. The services were restarted.
systemctl status php8.4-fpmshould show a start time after the upgrade, andcheckrestartshould have nothing PHP-related left to report. - 4. The website runs the new build. Check the version the web server reports, not just the command line: how to check your PHP version.
Patching removes the flaw, not anything an attacker left behind. CISA has listed both CVEs as known to be exploited since 26 October 2026, so if this server was reachable while vulnerable, read has your PHP site been compromised?
Troubleshooting
Common problems updating PHP on Debian
apt upgrade changes nothing and PHP is still 8.4.24
That is the main archive's build, so the security suite is
missing from the APT sources or apt update
was skipped. Go back to step 1.
A PHP package is held back
apt-mark showhold lists held
packages; sudo apt-mark unhold
followed by the package name releases one. Because
apt upgrade never removes
anything, an upgrade that needs a removal is also skipped;
apt full-upgrade can remove
packages, so read what it proposes.
php8.4-fpm fails after the restart
The journal shows why, and the FPM binary can test its own
configuration. Pool files live under
/etc/php/8.4/fpm/pool.d/.
journalctl -u php8.4-fpm -e
sudo php-fpm8.4 -t Some PHP packages come from Debian and some from packages.sury.org
dpkg-query -W 'php*' makes
this obvious: Debian's builds end in ~deb13u1
or ~deb12u1, the repository's
in a gbp suffix. Bring every
package of a branch to one source before relying on the result.
PHP runs in a container built from the official php image
The official image carries its own PHP build and blocks Debian's PHP packages, so apt inside the container does not patch PHP. Rebuild on a fixed image tag instead: updating PHP in Docker.
On Ubuntu the version numbers behave differently: updating PHP on Ubuntu. Red Hat style systems are covered in updating PHP on RHEL, AlmaLinux and Rocky Linux. The Linux overview compares all three, and the main update guide covers control panels, Windows and more.
Quick answers
Debian and PHP: questions people ask
Which PHP version does Debian 13 use?
PHP 8.4. Debian 13's php package is a dependency package that, in its own words, depends on the latest stable PHP version, currently 8.4. Debian 12 uses PHP 8.2 and Debian 11 uses PHP 7.4. Installing php, php-fpm or libapache2-mod-php always gives you the release's own branch.
Does Debian's fixed PHP version match the one on php.net?
For PHP2Shell, yes. Debian 13's update moved php8.4 to the upstream 8.4.27 release and Debian 12's moved php8.2 to 8.2.35, the same numbers the PHP project published. That is not guaranteed for every future fix: Debian's stated policy is to backport security fixes to the version a release shipped, so always check the advisory rather than the number alone.
Do I need to change my APT sources for Debian 12 LTS?
No, if the server already takes updates from Debian's security archive. The Debian LTS wiki says systems following security.debian.org receive LTS updates automatically, so DLA-4848-1 installs with a normal apt upgrade. If no bookworm-security line exists, add one, then run apt update.
Is there a PHP2Shell fix for Debian 11 bullseye?
Not from Debian. Bullseye's LTS period ended on 31 August 2026, and the Debian security tracker lists no bullseye package for either CVE. packages.sury.org does publish bullseye builds dated 21 October 2026, but the lasting fix is upgrading the server to Debian 12 or 13.
Should I use packages.sury.org instead of Debian's own PHP?
Only if you need a PHP branch your Debian release does not ship. Debian's own packages are patched by Debian's security and LTS teams and arrive through the security archive. Once packages.sury.org is added, its builds of your branch carry higher version numbers than Debian's and APT will choose them, so from then on that repository is your PHP supplier.
Know your exposure
Find every PHP server you run
Patching the server you know about is the easy part. A vulnerability scan finds the forgotten staging site, the old microsite and the appliance with PHP inside, then tells you which ones are still exposed.