Skip to content

WP Packages is our new WPackagist replacement that's 17x faster and updates every 5 minutes

  1. Blog

PHP2Shell: Patching PHP on Trellis Servers

Ben Word Ben Word

Updated October 23: Trellis v1.32.2 now disables PHP session upload progress by default, following new guidance from PHP (CVE-2026-115560).

PHP shipped a security release on October 21 for two critical vulnerabilities now known as PHP2Shell. Both allow remote code execution without logging in.

Every WordPress site on PHP-FPM is affected. The fixed versions are 8.2.35, 8.3.36, 8.4.27, and 8.5.12.

The vulnerabilities

PHP announced the security release on October 20, a day ahead of time, without details. The fixes and advisories followed on October 21:

The vulnerabilities were found by researchers at Wiz, OpenAI, and Calif (who demonstrated the attack against WordPress). PHP confirmed it works against PHP-FPM which is what Trellis uses.

On October 23, PHP recommended keeping session.upload_progress.enabled off until the next PHP release to block a third, less likely vector (CVE-2026-115560). Only apps that switch session.serialize_handler to php at runtime can be affected.

Upgrading PHP on Trellis

Trellis installs PHP with apt_package_state: present, which installs packages but never upgrades them, so re-provisioning alone won’t pick up the patch.

First, update to Trellis v1.32.2. If you’d rather not upgrade all of Trellis right now, the discussion below has steps for applying just the PHP role changes.

v1.32.2 also disables session upload progress by default, which PHP recommends keeping off. WordPress doesn’t use it. If you need it, set php_session_upload_progress_enabled: 'On'.

Then provision to upgrade PHP:

trellis provision --extra-vars apt_package_state=latest --tags php production

Finally, restart PHP-FPM on the server and confirm the version:

sudo service php8.4-fpm restart && php -v

Swap 8.4 for your php_version. You should see 8.4.27 (or 8.3.36, 8.5.12, 8.2.35). Repeat for staging and development.

If you already upgraded PHP, update Trellis and run trellis provision --tags php production to pick up the upload progress change. PHP-FPM reloads automatically.

Trellis moved to packages.sury.org

Trellis has long installed PHP from Ondřej Surý’s Launchpad PPA (ppa:ondrej/php). Ondřej also maintains packages.sury.org, which is the repository he now recommends, and a move was already in the works after a PPA metadata change started causing an interactive prompt during apt update (#1678).

Trellis v1.32.0 made the switch (#1680) on release day because packages.sury.org had the patched builds well before the PPA did.

v1.32.1 fixed removal of the old PPA on existing servers (#1696). With the PPA still configured and overloaded, provisioning could hang on the “Add Sury PHP repository” task.

Not using Trellis?

Run php -v on your server or check with your host. Any version below the ones listed above is vulnerable. Either way, set session.upload_progress.enabled = Off until the next PHP release.

More info

Questions or problems upgrading? Let us know!

About the author

Ben Word

Ben Word has been creating WordPress sites since 2004. He loves dogs, climbing, and yoga, and is passionate about helping people build awesome things on the web.

Subscribe for updates

Join over 8,000 subscribers for the latest Roots updates, WordPress plugin recommendations, modern WordPress projects, and web development tips.

One last step! Check your email for a verification link.

Sponsors

Roots is an independent open source org, supported only by developers like you. Become a sponsor.