To fix PHP2Shell, install a PHP release containing the security fixes and restart every worker. The first fixed upstream releases were 8.5.12, 8.4.27, 8.3.36 and 8.2.35; your distribution may provide a backported fix. Updating WordPress, Drupal, Laravel or a plugin alone won't fix the vulnerable runtime underneath them.
I made a video a while back begging you to update WordPress. You did, and I appreciate it. It didn't matter this time, because the hole was one floor down.
PHP disclosed the two bugs on 21 October 2026, and I've checked everything here against the advisories as they stand on 18 November. If you just want the fix, jump to the runbook. If you want to know how a memory limit turns into remote code execution and how the embargo collapsed a day early, read on.
What PHP2Shell is: two RCE bugs in the PHP runtime, not in your app
PHP2Shell is the nickname for two vulnerabilities PHP disclosed on 21 October 2026, in its security advisory (opens in a new tab):
- CVE-2026-109618 (opens in a new tab), which PHP calls "RCE via OOM corruption."
- CVE-2026-109619 (opens in a new tab), "RCE via stale global state."
Both are rated 9.2 on CVSS v4.0, PHP's official score; other databases may show a different number on the older CVSS v3.1 scale. The deleted Hacker News post that leaked the CVE numbers claimed a 10.0 (opens in a new tab), which was wrong, though I'd argue the panic was calibrated about right.
Wiz says (opens in a new tab) the affected code goes back to PHP 5.4.0, which shipped in March 2012. PHP's own advisories don't name a lower bound, but that's roughly fourteen years of PHP, and it covers every way PHP serves web traffic: PHP-FPM, Apache with mod_php, php-cgi, FrankenPHP and LiteSpeed. PHP says the risk is highest on mod_php, where a demonstrated exploit lands before any of your application code runs.
Code execution isn't the only outcome. PHP's GitHub advisory (opens in a new tab) classes the bug as a use-after-free and rates availability impact as high, and Wiz says the bugs include memory disclosure. Memory leaked from a PHP worker can hold database passwords, session tokens and API keys. Keep that last part in mind, because it changes what "cleaning up" means later.
The blast radius is huge. Cloudflare (opens in a new tab), citing W3Techs (opens in a new tab), put PHP at almost 70% of websites with a known server-side language at disclosure. Calif (opens in a new tab), the firm that reported it first, confirmed pre-auth RCE on WordPress 7.1.2, Drupal 11.4.3, Joomla 6.1.4, Magento 2.4.9, MediaWiki 1.46.2, Roundcube 1.7.4, phpMyAdmin 5.2.3, Nextcloud 35.0.1, Laravel 13.11, Symfony 8.1 and WHMCS. Wiz (opens in a new tab) says even a plain "Hello World" script on an affected PHP build can be vulnerable.
That Hello World detail is the one that got me, because it means nobody gets to say their code is too simple to be exposed.
How running out of memory turns into remote code execution
I'm keeping this at the concept level on purpose. The mechanism is worth understanding, but a step-by-step recipe isn't something you need to patch your servers.
Every PHP request runs with a memory budget, memory_limit. When a request blows
through it, PHP throws a fatal error and stops the request. Everyone, including me, has treated
that as the safe failure mode for twenty years, since the request dies and the worker moves on.
The trouble is where the request dies. If PHP runs out of memory halfway through building some internal structure, the bookkeeping for that half-built thing can survive the abort. Cleanup then treats it as valid, or a pointer keeps referring to memory that has already been freed.
On PHP-FPM, a single worker process handles many requests in sequence, so that leftover state doesn't vanish when the request does. The next request on the same worker picks it up and trusts it.
attacker request #1 one PHP-FPM worker process
─────────────────── ──────────────────────────────────────────
oversized crafted request ───────────────▶ PHP starts building request data
(e.g. session upload progress)
memory_limit hit mid-build ──▶ fatal error
bookkeeping left pointing at freed memory
▲
└── the bug
attacker request #2
───────────────────
follow-up request ───────────────▶ same worker reuses the stale state
attacker-shaped data lands where PHP
trusts it ──▶ code execution
PHP's advisory splits this into the two CVEs. In 109618, running out of memory interrupts PHP while request data is half-built, and cleanup treats that data as valid. In 109619, state from one request survives after its memory is freed, and the next request on that worker uses it before normal initialization resets it.
The confirmed paths are session upload progress and, on PHP 8.5, fatal-error backtraces.
Session upload progress is on by default, and it doesn't need your app to call
session_start(), which is why this reaches apps that never touch sessions.
An error path everyone assumed was safe turned out to be the attack surface.
That's the part I'd want every engineer to take away. Most of us review the happy path and the obvious failure branches. Hardly anyone asks what state is left lying around when the runtime itself bails out halfway through a function.
Who found PHP2Shell, and why AI changed the disclosure math
The short version is people, using AI, several times over.
- Calif was working inside OpenAI's Patch the Planet initiative, which it joined on 30 July. It found the first out-of-memory issue on 1 August, reported it to PHP on 11 August, sent a working RCE proof of concept on 14 August and reported the second bug on 21 August. Calif says it used no special harness and only generally available models for the initial find.
- Wiz found the bugs independently on 19 August using Wiz Atlas, Gemini 4 Argon and GPT-5.6 Sol. It had unauthenticated RCE on Drupal the next day and WordPress the day after, and reported to PHP on 24 August. Wiz says one researcher did in a week "what previously would have taken a world-class team months of work," and puts the moment alongside Heartbleed and Log4Shell as a turning point.
- Chainguard told TechTarget (opens in a new tab) it learned a disclosure was coming on 16 October and found the same flaw that night, with an in-house AI harness and a frontier model.
- Amazon's MadPot honeypots logged an exploitation attempt on 17 October (opens in a new tab), four days before public disclosure. AWS says it's unclear how that actor got the information.
This is the part I keep coming back to. Coordinated disclosure assumes the people who know about a bug are a small, slow-growing group, so you can quietly build patches while the secret holds.
When finding a bug drops from months of expert time to a week with a model, that assumption stops holding. Two fully independent discoveries less than three weeks apart, a third team that only needed a hint and one evening, plus an attacker who may have been a fourth, don't look like bad luck to me. They look like the new normal.
How the PHP2Shell embargo fell apart a day early
The plan, per the PHP Foundation's postmortem (opens in a new tab), was a coordinated release on Thursday 22 October at 14:00 UTC. It didn't survive Tuesday.
| When (2026) | What happened |
|---|---|
| Tue 20 Oct | An anonymous Hacker News post named the CVE numbers. It was deleted, but the screenshots kept circulating. |
| Tue 20 Oct, 19:30 UTC | PHP's advance notice (opens in a new tab) moved the release up to Wednesday 21 October, 14:00 UTC (10:00 ET). |
| Tue 20 Oct, ~20:00 UTC | Calif mistakenly published a short exploit demo video and took it down. The PHP Foundation says copies had already spread and sped up proof-of-concept work. |
| Wed 21 Oct, 03:02 UTC | Cloudflare turned on default WAF protection for Free and paid plans. |
| Wed 21 Oct, 07:41 UTC | Chainguard published patched images, more than six hours early. |
| Wed 21 Oct, 14:00 UTC | PHP released 8.5.12, 8.4.27, 8.3.36 and 8.2.35. |
| Wed 21 Oct | watchTowr's honeypots (opens in a new tab) saw both CVEs exploited in the wild. |
The Chainguard call became a point of contention. The PHP Foundation says Chainguard broke the embargo unilaterally, since a published patch is a map to the bug for anyone who diffs it. Chainguard's Dan Lorenc wrote on LinkedIn that the call rested partly on "the evidence shared on active exploits in the wild," and TechTarget reports (opens in a new tab) he regretted the added stress it caused the maintainers. But asked by The Register (opens in a new tab) whether he'd do anything differently, he said no.
I don't think there's a clean answer here. If you already believe attackers have it, holding a fix back only protects the schedule.
If you're wrong, though, you just handed everyone else a diff six hours before the defenders were ready.
Cloudflare's CEO Matthew Prince gave a sense of the volume: thousands of attempts in the ten hours before the announcement, tens of thousands in the 45 minutes after, hundreds of thousands within two hours, and millions by 22 October.
How to fix PHP2Shell: the runbook, in order
This is the order I'd work in. Before changing an exposed server, preserve the logs and any incident evidence you need for investigation; step 6 has starting points. Then update, verify and restart. Steps 4 and 5 cover temporary protection, step 6 covers cleanup, and step 7 covers a separate issue that can still matter after the original patches.
Step 1: Update PHP itself to a fixed release
The first fixed upstream releases were 8.5.12, 8.4.27, 8.3.36 and 8.2.35. Install the latest supported stable release for your branch containing these fixes, rather than treating those numbers as permanent targets. PHP's security advisory (opens in a new tab) still identifies updating as the complete fix for the two original CVEs.
If you installed PHP from your distro, take your vendor's patched package rather than chasing
upstream numbers. On Ubuntu that's
USN-8948-1 (opens in a new tab).
Distros backport the patch into their existing version string, so a fixed Ubuntu 24.04 box reports
8.3.6-0ubuntu0.24.04.13, nowhere near 8.3.36. Check the vendor advisory, not just
php -v.
If you use PHP's official Windows binaries, also check the
26 October package rebuilds (opens in a new tab).
The -1 packages update Brotli for a separate vulnerability, CVE-2026-111497,
without changing the PHP runtime version. A version check alone won't identify that package fix.
On managed hosting, open a ticket and make your host confirm the patched build for your account. "We're aware of the issue" isn't a confirmation.
For older branches, PHP's security team published minimal source backports for 7.4, 8.0 and 8.1, and distros and LTS vendors are shipping fixes too. 7.3 and older get nothing from the PHP project.
Step 2: Check the PHP that actually serves your site
This is the one I'd bet catches a lot of people. The php in your terminal is the CLI
binary, and it can be a completely different version from the one behind your web server. I've
seen boxes where the CLI was freshly upgraded and FPM was still running the branch from three
years ago.
# The CLI version. Useful, but not what serves your site.
php -v
# Which PHP-FPM masters are running, and with which config.
# On Debian/Ubuntu the config path includes the branch, e.g. /etc/php/8.3/fpm/...
ps -eo pid,lstart,args | grep '[p]hp-fpm: master'
# Is Apache loading mod_php?
apachectl -M 2>/dev/null | grep -i php
# Installed PHP packages and their versions
dpkg -l | grep -E '^ii +(php|libapache2-mod-php)' # Debian/Ubuntu
rpm -qa | grep -E '^php' # RHEL, Alma, Rocky, Fedora
The most reliable check is to ask the web server directly. I drop a throwaway script with a random name, hit it once and delete it, so I never leave a version disclosure page lying around:
WEBROOT=/var/www/html # your document root
SITE=https://example.com # your site
f="v-$(openssl rand -hex 8).php"
echo '<?php echo PHP_VERSION, " ", PHP_SAPI, " upload_progress=", var_export(ini_get("session.upload_progress.enabled"), true), "\n";' \
| sudo tee "$WEBROOT/$f" >/dev/null
curl -s "$SITE/$f"
sudo rm -f "$WEBROOT/$f"
You'll get something like 8.3.36 fpm-fcgi upload_progress='1'. The SAPI tells you
which runtime answered, and the last field becomes useful in step 4.
Step 3: Restart every PHP worker
A patched binary on disk does nothing for a worker that's still running the old one in memory. This matters more than usual here, because the bugs are literally about state that survives inside long-lived workers.
# Debian/Ubuntu: the unit name includes the branch
sudo systemctl restart php8.3-fpm
# RHEL family
sudo systemctl restart php-fpm
# mod_php runs inside Apache, so restart Apache
sudo systemctl restart apache2 # or: httpd
# Confirm the master's start time is after you patched
ps -eo pid,lstart,args | grep '[p]hp-fpm: master'
For containers, rebuild from a patched base image and recreate them. Restarting an old container just runs the old PHP again.
# "app" = your PHP service name. Only recreate that service, not the database.
# If the service uses a published image (image: in compose.yaml)
docker compose pull app
# If you build it from a Dockerfile, skip the layer cache so PHP is reinstalled
docker compose build --pull --no-cache app
docker compose up -d --no-deps --force-recreate app
If your Dockerfile pins something like php:8.3.30-fpm, --pull won't save
you. Bump the tag first. And if you install PHP with apt or apk inside the
Dockerfile, a cached build can quietly reuse the old package, which is why the build above uses
--no-cache.
After restarting, repeat the web request from step 2 for every backend serving the site.
docker compose exec app php -v checks only the container's command-line PHP; it doesn't prove
that the web workers loaded the fixed runtime.
Step 4: If you truly can't patch today, use the stopgaps (and know what they cost)
PHP lists stopgaps for systems that can't update immediately, and says plainly that they "do not make an installation safe." Treat each one as a way to buy hours, not as a place to stop.
Turn off session upload progress. This has to be set where PHP reads it before
the request starts: php.ini, the FPM pool, or the server config. PHP's advisory is
explicit that ini_set() and .user.ini don't work for this one.
; php.ini
session.upload_progress.enabled = 0
; PHP-FPM pool, e.g. /etc/php/8.3/fpm/pool.d/www.conf
php_admin_flag[session.upload_progress.enabled] = off
# Apache vhost with mod_php
php_admin_flag session.upload_progress.enabled off
Restart afterwards, then run the throwaway check from step 2 again. You want
upload_progress='' or '0' instead of '1'. The cost is that
any upload progress bar built on this feature stops working, and in my experience few apps rely on
it.
On PHP 8.5, also turn off fatal error backtraces:
fatal_error_backtraces = 0
You lose stack traces on fatal errors in your logs until you patch, which is annoying when debugging but not much worse than that.
For CVE-2026-109618, PHP suggests removing the memory limit with
php_admin_value[memory_limit] = -1, together with strict request, multipart and size
limits at the server or proxy. Even PHP notes that an underlying allocation failure can still reach
the vulnerable path, so this narrows the door rather than closing it.
This is the stopgap I'm least comfortable with, because it adds a denial-of-service risk without fully removing the RCE risk. One runaway script can now eat the whole box. If you do it, cap request size in front of PHP and put a ceiling on the service itself. Make all three changes first, then restart PHP once at the end so the workers pick up the final config:
# nginx, in the server block for the PHP site
client_max_body_size 8m;
# then test and reload nginx, or the new limit never takes effect
sudo nginx -t && sudo systemctl reload nginx
; php.ini, keep these tight while memory_limit is off.
; If the app needs bigger uploads (PHP suggests 32M), raise all three together:
; post_max_size, upload_max_filesize (a little below it) and nginx's
; client_max_body_size. Raising only one will break uploads.
post_max_size = 8M
upload_max_filesize = 6M
max_file_uploads = 5
max_input_vars = 1000
# Hard ceiling for the whole FPM service, enforced by its cgroup
sudo systemctl edit php8.3-fpm
# then add:
# [Service]
# MemoryMax=2G
# OOMPolicy=continue
sudo systemctl restart php8.3-fpm
PHP's advisory recommends exactly this kind of container or cgroup limit, and warns against
using RLIMIT_AS or RLIMIT_DATA instead, since those can trigger the very
allocation failure you're trying to avoid. Size MemoryMax for your
pm.max_children and real traffic.
The OOMPolicy=continue line tells systemd to keep the service running if an OOM
kill takes a worker. The default depends on the unit and the manager's configuration; don't
assume it is the same on every host. It also doesn't guarantee the kernel will select a worker
instead of the master. Check the effective service and cgroup settings against
systemd's documentation (opens in a new tab)
and validate the behavior before relying on it for availability.
Hiding errors does nothing. Changing error_reporting,
display_errors or sprinkling @ around only changes what gets printed.
The memory corruption happens either way.
Step 5: Put a WAF in front, as a speed bump
Wiz says it worked with Google Cloud, Cloudflare, AWS, Microsoft, Automattic, Fastly, Akamai, Imperva, Vercel and others on detections and out-of-the-box mitigations. If your provider has a rule, turn it on and check two things: that it's set to block, not just log, and that nobody can reach your server directly by its IP and skip the WAF entirely.
The catch is that Cloudflare says customers who changed session.upload_progress.name
aren't covered by its rule. If your config renames that field, check whether your provider's rule
still sees it. A WAF matches what an attack looks like on the wire, while the patch removes the
bug, so I'd only ever count the WAF as buying time.
Step 6: Assume someone may have already knocked
Attempts started at least four days before disclosure, Cloudflare saw millions of requests within the first day, and real break-ins have since been confirmed (see below). If you were unpatched and reachable, investigate before you assume you're clean.
Work from the evidence you preserved before updating. If you haven't saved your logs yet, do that now; restarts and log rotation can destroy exactly the evidence you need.
# Snapshot logs first
sudo tar czf "/root/logs-$(date +%F-%H%M).tgz" /var/log
# PHP files written or modified since the first known attempt (17 Oct).
# mtime can be faked, so treat a clean result as "nothing obvious", not "nothing".
sudo find /var/www -type f -name '*.php' -newermt '2026-10-17' -ls
# Every user's crontab, plus the system cron directories
for u in $(cut -d: -f1 /etc/passwd); do
sudo crontab -l -u "$u" 2>/dev/null | sed "s/^/$u: /"
done
ls -la /etc/cron.d /etc/cron.hourly /etc/cron.daily
# Established outbound connections owned by PHP processes
sudo ss -tnp state established | grep -i php
# Workers dying on memory limits (check wherever your error_log points;
# with nginx + FPM these often show up in the nginx error log)
sudo grep -h "Allowed memory size" /var/log/php*fpm*.log /var/log/nginx/error.log 2>/dev/null | tail -n 50
Wiz also suggests watching for unexpectedly large or malformed PHPSESSID response
cookies, and AWS suggests hunting for POST requests carrying PHP_SESSION_UPLOAD_PROGRESS
in form uploads. Most default access logs record neither cookies nor POST bodies, so you may only
be able to see this at the WAF or load balancer.
Because these bugs can leak memory, rotate the secrets that lived on that server: database passwords, API keys, OAuth client secrets, signing keys and session secrets. Then log everyone out: clear stored sessions and revoke issued API and refresh tokens, because a stolen session keeps working after the password changes. I know it's the step everyone skips, but a leaked key keeps working after the server is patched.
If you find signs of a break-in, patching isn't the fix. An attacker who got in may have left a web shell or a cron job behind, and those survive a PHP update. Take the server off the network, keep your evidence, and rebuild it from a clean image or a backup from before 17 October. Rotate secrets from a different, clean machine, or the new ones leak too.
Step 7: Check the separate CVE-2026-115560 advisory
On 23 October PHP flagged a related, narrower issue (opens in a new tab), CVE-2026-115560. The advisory available on 18 November still describes a fix planned for a regular release. The four original PHP2Shell fixes don't cover this separate issue.
PHP describes a specific combination: upload progress is enabled, the configured
session.serialize_handler is php_binary or php_serialize,
and the application switches it to php with ini_set() before
session_start(). If that applies, keep upload progress disabled as in step 4 and
follow PHP and your vendor for the fix. Include dependencies in your review; checking only your
own code for serialize_handler isn't enough to establish that a system is safe.
Patch now, stopgap, or take it offline: picking your trade-off
The NSA (opens in a new tab) gave the bluntest advice: if you can't update immediately, take the system offline until it's fully mitigated. Plenty of people actually did that.
Government sites went down in France, Denmark, Finland and the Netherlands (opens in a new tab), including the Dutch cybersecurity agency's own site. In the UK, tech minister Elizabeth Lloyd told the House of Lords (opens in a new tab) that 32 government services were unavailable and four partly unavailable. Australia's ACSC issued its highest-rated alert on 21 October, and cyber.gov.au went dark (opens in a new tab) while fixes went in.
Wikimedia pulled some systems as a precaution, and in Japan MUFG suspended some online banking services (opens in a new tab) while ANA paused its ANA Pocket app, alongside a long list of other companies.
That sounds dramatic, but I think it's the correct call for a lot of systems, and here's how I'd decide:
- Patch and restart whenever you can do it in the next few hours. It's the only option that actually removes the bug.
- Stopgaps plus a WAF if the patch is blocked, say by an EOL branch or a vendor appliance, and the system has to stay up. Accept that you're reducing risk, not removing it, and set a deadline.
- Take it offline if it's internet-facing, unpatched, and running something like phpMyAdmin, WHMCS or an admin panel that holds secrets. A few hours of downtime is cheaper than an incident response and a full credential rotation.
The option I'd rule out is "wait for a public exploit before deciding." The PHP Foundation said it had found no functional public exploits at release, plenty of GitHub repos claimed otherwise, and watchTowr saw real exploitation the same day.
Don't test with a stranger's repo
Running a random GitHub "PoC" against your own server to see if you're vulnerable is its own security incident. Check the version the web server reports instead, as in step 2.
The PHP end-of-life problem PHP2Shell dragged into the light
According to the PHP Foundation, the first signs of the out-of-memory issue turned up in 2024, around an external Quarkslab audit. Competing fixes each broke something, whether backward compatibility, new denial-of-service potential or third-party extensions, and the work stalled. Two years later, AI-assisted researchers walked back through the same door.
I'm not dunking on the maintainers here. Fixing a memory-safety bug in an engine this old without breaking millions of deployments is really hard, and the Foundation itself calls what happened a "structural failure" of process and resources. But the bug didn't stall with it.
The version picture makes it worse. Qualys (opens in a new tab) looked at about 155 million PHP installations with a known version across its customer base and found 71%, about 110 million, on branches PHP no longer supports, 5.4 through 8.1. In the first twelve hours, about 199,000 installations got patched. That's progress, but it's a small slice of 155 million.
PHP's support schedule (opens in a new tab) puts PHP 8.2's end of life on 31 December 2026. If you're still on 8.2, patch it and schedule an upgrade to a supported branch with enough remaining support time for your application.
What PHP2Shell attack reports do and don't tell you
The October disclosure reports are useful history, but they aren't a live picture of exposure. Later research changes what we can say about successful attacks:
- Successful compromises have been reported. Dream's report, updated 29 October (opens in a new tab), describes a campaign that chained PHP2Shell with a Linux kernel privilege escalation and compromised 25 PAN-OS firewall and management servers. Palo Alto Networks' Unit 42 (opens in a new tab) says it independently verified the attacker's tooling and confirmed the reported results, and advises restricting management access and applying PAN-OS fixes. That is a campaign-specific finding, not a count of every PHP2Shell compromise. Appliance owners need their vendor's fixed firmware, too.
- Other attacks have succeeded too. GreyNoise has seen at least six successful exploitations (opens in a new tab) of the two CVEs, and on 26 October CISA added both to its Known Exploited Vulnerabilities catalog (opens in a new tab), its list of bugs confirmed as used in real attacks.
- Early access isn't explained by the timeline alone. AWS's disclosure report didn't establish how the 17 October actor learned about the issue. That observation alone doesn't establish a leak or an independent discovery.
- Version surveys have limits. The Qualys figures above describe its customer sample at disclosure. In a 9 November follow-up (opens in a new tab), Dream still found affected version reports in a selected government and military sample using 4 November scan data. It explicitly warns that advertised versions can miss vendor backports. Neither survey establishes whether your server is patched; your installed package and vendor advisory do.
PHP2Shell FAQ
Is updating WordPress enough to fix PHP2Shell?
No. PHP2Shell is in the PHP runtime, not in WordPress or any plugin. Install the latest supported stable PHP release containing the fixes, or your distro's patched package, then restart PHP-FPM or Apache. The first fixed upstream releases were 8.5.12, 8.4.27, 8.3.36 and 8.2.35.
Which PHP versions are affected by PHP2Shell?
Every PHP release before 8.5.12, 8.4.27, 8.3.36 and 8.2.35 is affected, going back to PHP 5.4 according to Wiz, across PHP-FPM, mod_php, php-cgi, FrankenPHP and LiteSpeed. PHP published minimal source backports for 7.4, 8.0 and 8.1. Anything older gets nothing from the PHP project, so you need a distro or LTS vendor fix or an upgrade.
Does a WAF protect against PHP2Shell?
Partly. Cloudflare, Akamai, Microsoft, Vercel and others shipped rules that block known attack patterns, but they're a stopgap. Cloudflare's rule only covers the default session.upload_progress.name, and only patching PHP removes the bug.
How do I check if my server is vulnerable to PHP2Shell?
Check the version the web server actually runs, not just php -v in the terminal, which is the CLI binary. Use a temporary script that prints PHP_VERSION and PHP_SAPI through the web server, or check your package manager against your distro advisory, then confirm the workers were restarted after the update.
Where I've landed
I've spent years telling people to update their CMS, and that advice still stands, but PHP2Shell is a reminder that the stack goes all the way down and the boring layers are the ones nobody's watching.
My honest prediction is that we'll see more of exactly this: old, well-audited runtimes, bugs in the error paths, found by several teams at once because the models make the search cheap. Finding bugs got a lot faster, and patching didn't.
So this week I'm going through every box I own, including the appliances I forget run PHP, and running step 2 against the web server, not the terminal. I'd bet at least one of them surprises me.
Further reading: Calif's write-up (opens in a new tab), Wiz's research post (opens in a new tab), CNN's explainer (opens in a new tab) and the PHP Foundation's postmortem (opens in a new tab).