Fix PHP2Shell on Homebrew

Homebrew builds its own PHP packages. A fixed package can keep an older version number with the patch added, so look for the package version below rather than for 8.4.27.

Release by release

ReleaseStatusFixed packageAdvisory
php (8.5)Fixed packageFormula commit 14:12Z, bottle 17:27Z. formulae.brew.sh API JSON still showed 8.5.11 revision 1 (stale cache); run brew update first.8.5.12–2026-10-21
php@8.4Fixed packageBottle 16:25Z.8.4.27–2026-10-21
php@8.3Fixed packageBottle 16:19Z.8.3.36–2026-10-21
php@8.2Fixed packageBottle 16:54Z.8.2.35–2026-10-21
php@8.1No fix yetLast update 2026-10-13, 8.1.34, not patched.––

Confirm the fix is installed

brew update && php -v  # expect 8.5.12 / 8.4.27 / 8.3.36 / 8.2.35 or newer

Restart PHP

Installing the package replaces the files on disk. PHP processes that are already running keep the old code.

brew upgrade php && brew services restart php  # versioned: brew services restart php@8.4

If your release has no fix yet

Watch the advisory feed for your release and install the update the day it lands. Until then, the triage page lists the official temporary measures. If your release is past its end of life, read options for old versions.

Pages we read