PHP2Shell: what to do

PHP2Shell is two critical PHP bugs, CVE-2026-109618 and CVE-2026-109619. They can let anyone on the internet run code on your web server. They affect sites running PHP through PHP-FPM, Apache mod_php, php-cgi, FrankenPHP or LiteSpeed. Fixed PHP versions came out on 21 October 2026.

Step 1: update PHP. That's the real fix. Everything else on this site only lowers the risk until you can.

Am I affected?

Your PHPSafe from
8.58.5.12
8.48.4.27
8.38.3.36
8.28.2.35
8.1 and olderno official fix: upgrade

Ubuntu, Debian and Red Hat may patch older-looking versions. Check with your vendor.

Use the tool

One PHP file, nothing to install. Run it from your project folder (Linux / macOS):

curl -fsSL https://wasdthedebugger.github.io/php2shell/fix | php

Need admin rights to edit PHP's config? Use | sudo php. Prefer to read it first, or on Windows? Download it instead.

It asks simple questions, shows what it will change, backs up first, and can undo. How to run it.

The fixes

  1. Update PHP (the real fix)
  2. Turn off the memory limit CVE-2026-109618
  3. Lower the max request size CVE-2026-109618
  4. Keep the upload limit below the request limit CVE-2026-109618
  5. Turn off session upload progress CVE-2026-109619
  6. Turn off fatal error backtraces (PHP 8.5) CVE-2026-109619
  7. Limit request sizes in the web server CVE-2026-109618
  8. Limit memory outside PHP CVE-2026-109618
  9. Settings in your project that undo the fixes

Not sure where your config lives or how to restart PHP? See your setup.