Patch tonight. Migrate to modern, AI-improved.
How to patch PHP2Shell
Last updated: 2026-10-23 · Shawn Gants
The only complete fix is a patched PHP build, then a restart. Your host or system administrator does that work. Cprofessionals does not patch PHP on your server. The steps below are the ones PHP, Tag1, CISA and AWS have published. Temporary ini changes are included only as the stopgaps PHP itself listed, and they are not a fix.
- Identify the PHP version the web server runs (Drupal Status report, WordPress Site Health, or a phpinfo page served by the site). The CLI
php -vcan differ. (Tag1) - On shared or managed hosting, choose the newest PHP in the panel and ask the host to confirm the patched build and a restart.
- On a VPS (Ubuntu/Debian), install the distro security update. Tag1 cites Ubuntu USN-8948-1/-2 and Debian DSA-6574-1 / DLA-4848-1. Verify with the package manager, not only
php -v. (Tag1) - In Docker, pull fresh official images and rebuild. Running containers keep the old PHP. (Tag1)
- Restart Apache (mod_php), PHP-FPM and long-running workers.
- On PHP 8.1 or older, use a vendor backport, the PHP security team's source backports for 7.4, 8.0 and 8.1, or upgrade. Skip 8.2 when you upgrade. It ends December 31, 2026. (php.net, Tag1)
- If you truly cannot update yet, PHP's own advisory lists temporary measures that reduce exposure and "do not make an installation safe": set
session.upload_progress.enabled=0in php.ini, the FPM pool, or Apache config (notini_set); setmemory_limit=-1viaphp_admin_valueplus a container or cgroup limit; setpost_max_sizeto 8M (or 32M if you need uploads); setfatal_error_backtraces=0on 8.5; then restart every worker. These are not a fix. (php.net) - After patching, rotate secrets. Review logs from October 17 for
PHP_SESSION_UPLOAD_PROGRESSPOSTs and unexpected processes. (AWS)
If the site is already down, an overnight rebuild is a migration, not a PHP patch. Emergency migration pricing.