Drupal Sites and Black October: Updating PHP Without Breaking Drupal
PHP2Shell affects Drupal through PHP itself. How to read the version from the Status report, why Drush can show the wrong number, what to do on Drupal 7, and how to roll the update across several environments.
Drupal teams tend to be good at core security updates, which creates a blind spot this month: PHP2Shell is not a Drupal advisory. The two flaws fixed on 21 October 2026 live in PHP, and a fully patched Drupal on an unpatched PHP is exposed. If you have not read the background, start with the Black October overview.
Read the version Drupal actually runs on
Go to Reports → Status report (/admin/reports/status). The PHP line there comes from the web request, so it reflects the PHP that serves visitors.
Be careful with drush status. Drush runs from the command line, and on many servers the command-line PHP is a different build from the PHP-FPM pool serving the site. A green Drush result does not prove the site is patched. The safe versions are 8.2.35, 8.3.36, 8.4.27 and 8.5.12 and later in each line, plus distribution packages that include the backported fix. Other ways to check are in the PHP version guide.
Updating PHP on Drupal 10 and 11
Recent Drupal releases run on PHP 8 branches that received fixed releases, so most sites only need a patch-level update within the same branch:
- Update the PHP packages on every web server (and on any separate cron or queue servers).
- Restart PHP-FPM, or Apache if you use mod_php.
- Clear Drupal's caches (
drush cr) so nothing stale is served. - Recheck the Status report on each environment.
If you also need to change PHP branch, check Drupal's published PHP requirements for your core version and test contributed modules on a staging copy first. Composer can help: composer why-not php 8.4 lists packages that block a given PHP version.
Several environments, one rule
Drupal sites often run on development, staging and production, sometimes behind a load balancer with several web nodes. Each one has its own PHP. Patch production first, since it faces the internet, and patch every node behind the balancer, not just the one you happened to log into. Staging and development copies exposed to the internet need the same treatment; a forgotten staging site is a classic way in.
Drupal 7
Drupal 7 reached end of life in January 2025, and many Drupal 7 sites still run on PHP 7.4 or 8.0 or 8.1. Those branches get no official PHP release for these flaws. Your options are a vendor or distribution that backports PHP fixes, building PHP from the PHP team's backport branches (see the old PHP versions guide), or finishing the migration you have probably been postponing.
Things that will not protect you
- Drupal's own flood control and permission settings act after PHP has parsed the request; the most serious attack path happens earlier.
- Setting PHP values in
settings.phpwithini_set()runs too late. The PHP team says the temporarysession.upload_progressworkaround must be set inphp.ini, the FPM pool or the server configuration. See the stopgap guide.
Checking a Drupal site for intruders
- People page: administrators you do not recognise.
sites/default/files: should contain uploads, never.phpfiles. Drupal ships an.htaccessthere that blocks running PHP on Apache; confirm it is still present and unchanged.settings.php: check for unfamiliar includes or code.- Recently changed files under
core,modulesandthemesoutside your deployment history.
If you use Git to deploy, git status on the server is the quickest way to spot files that changed outside a deployment. The compromise checklist covers the rest.
Move your site to WeInc
For a marketing site that no longer needs Drupal's depth, a hosted builder removes the server work entirely. Move your site to WeInc: first month free with code BLACKOCTOBER, until November 21, 2026. New customers only. Claim the offer
More in Blog
- Joomla and the PHP2Shell Flaws: Patching Steps for Joomla 3, 4 and 5
- Laravel Apps and PHP2Shell: Patching Forge, Vapor, Octane and Docker Setups
- Magento and Adobe Commerce: Handling the PHP2Shell PHP Flaws
- Still on PHP 7.4, 8.0 or 8.1? Your Options After PHP2Shell
- PrestaShop Store Owners: Fixing Your Shop After the PHP2Shell Disclosure
- PHP2Shell Stopgap: Disabling session.upload_progress and Other Temporary Measures
- After Black October, Should You Move Your Website Off PHP? An Honest Answer
- Was My Site Hacked Before I Patched PHP2Shell? How to Check and What to Do
Related guides and tools
Start building
- how to make a website
- AI website builder
- free website builder
- website templates
- website builders by industry
How we research, test and update this page: our editorial policy. We.Inc is our own product.
Product
Who It's For
- For Agencies
- For Freelancers
- For Hosting Providers
- For SaaS Platforms
- For Startups
- For Financial Services
- For Healthcare
Features
- Drag & Drop Editor
- Built-in SEO Tools
- Custom Branding
- Client Dashboard
- Reseller Billing (Stripe Connect)
Resources
- Blog
- Help Center
- Free Business Tools
- Free UI Components
- Website Templates
- Template Collections
- Website Examples
- Guides
- Comparisons
- Alternatives
- Best Lists
- Reviews
- Pricing Guides
- Use Cases
- Glossary & Guides
- Integrations
- Developers
- Benchmark
- Windows App