The php2shell vulnerability: how to check and fix your PHP site
Two critical PHP flaws fixed on October 21, 2026 are now on CISA's exploited list. Here's how to check your site, get it patched and look for signs of a break-in.
That critical error after a PHP update is usually one plugin or theme. Here's how to get the site back up safely, find the culprit and stop it happening again.
Seeing "There has been a critical error on this website" right after your host changed the PHP version? That's the classic WordPress critical error after PHP update, and it almost always means one plugin, theme or piece of custom code uses PHP that the new version no longer accepts. PHP stops with a fatal error, and WordPress shows that message instead of your page. Your posts, pages, orders and settings are still safe in the database.
The calm way out has 3 parts. Get the site back up with the recovery mode email WordPress sends, or by switching PHP back in your hosting panel. Find the plugin or theme that failed. Then update or replace it and move PHP forward again.
PHP is the programming language WordPress is written in. Your host runs it and lets you choose the version. Each new version removes or tightens some older features, so code that worked yesterday can stop today.
Since WordPress 5.2, fatal error protection catches these errors and shows a message instead of a blank white page. Visitors see "There has been a critical error on this website." On the login page or dashboard, it adds "Please check your site admin email inbox for instructions." WordPress's Common WordPress errors guide lists the usual causes:
When the error appears minutes after a PHP change, the new version is rarely the real problem. One plugin or theme just isn't ready for it. That's good news: you don't need to rebuild anything, you need to find one folder.
When a plugin or theme causes a fatal error, WordPress emails the site's admin address with a secret recovery link. The subject line reads "[Your site name] Your Site is Experiencing a Technical Issue", and the email says whether WordPress caught the error in one of your plugins or in your theme, and names it.
Step 4 matters. Recovery mode pauses the broken plugin only for you, the person in recovery mode. WordPress's developers say the pause "does not have any global implications", so visitors keep seeing the error until you deactivate, update or replace the plugin.
No email? Check spam, then check where it went. It goes to the Administration Email Address under Settings > General, and WordPress's Settings documentation advises sites set up by a developer or agency to make sure that address is one your business can access. By default WordPress sends this email at most once a day, so don't wait for another one.
Send your website and we will record a free 2 minute video showing the 3 fixes we would make first.
If recovery mode isn't an option, the quickest fix is to switch PHP back to the version you had before, on the same panel screen you used to change it. Our guide on how to update PHP version in WordPress shows where that setting lives in cPanel, Hostinger, Plesk, SiteGround and Bluehost.
One rule before you click: the version you go back to must still be supported and patched. On October 21, 2026, PHP released fixes for 2 critical remote code execution flaws, CVE-2026-109618 and CVE-2026-109619, known as php2shell. According to the php.net security advisory, the fixed versions are:
The same advisory says PHP 8.1 and older no longer receive updates from the PHP project. If your site ran 8.1 or 7.4 before, don't go back there: fix the plugin instead, or ask your host for help. After any switch, check the full version number in Tools > Site Health > Info > Server.
Treat a rollback as breathing room, not the fix. php.net's supported versions page shows PHP 8.2 gets security fixes only until December 31, 2026 (more in our post on PHP 8.2 end of life). Some hosts also limit how far back you can go, so if your old version isn't in the menu, ask support.
If you didn't get the email, the error log tells you exactly which file failed.
Look in your hosting panel first. In cPanel, the Errors page under Metrics shows the 300 most recent web server error log entries. Depending on how your host runs PHP, PHP errors may be logged elsewhere, so if you can't find them, ask your host or use the WordPress debug log below.
WordPress can write every error to a file. Open wp-config.php in your site's main folder using your host's File Manager or an FTP app, and add these 3 lines above the comment that tells you to stop editing:
define( 'WP_DEBUG', true );define( 'WP_DEBUG_LOG', true );define( 'WP_DEBUG_DISPLAY', false );These come from WordPress's Debugging in WordPress guide. The first turns on debug mode, the second saves errors to wp-content/debug.log, and the third keeps them off the screen. Reload the broken page once, open debug.log and search for "PHP Fatal error". The file path on that line names the culprit: wp-content/plugins/ plus a folder name means a plugin, wp-content/themes/ means a theme.
When you're done, remove the 3 lines and delete debug.log, since the same guide says debug tools are not recommended on live sites.
If you can't log in at all, deactivate plugins from File Manager or FTP. WordPress's troubleshooting FAQ describes this method:
wp-content, rename the plugins folder to plugins.hold. This disables every plugin but keeps their settings.plugins.hold back to plugins. Every plugin now shows as deactivated.If the log already named the plugin, rename only that plugin's folder, for example old-slider to old-slider-off. If the theme is the problem, rename the active theme's folder inside wp-content/themes. When the active theme's files are missing, WordPress switches to a default theme if one is installed, so keep one on every site.
Once you know which plugin or theme failed, the fix usually follows one of these patterns.
| Symptom | Likely cause | Fix |
|---|---|---|
| Email or log names a plugin you haven't updated in months | Outdated plugin | Update it. If no update exists, replace it with a maintained plugin. |
| Error names a paid add-on for a page builder, form or store plugin | Add-on and main plugin out of step, often after a license lapsed | Renew or log in to the vendor account, then update the add-on and main plugin together |
Log path points to wp-content/themes/ | Old theme or child theme code | Update the theme, or use a default theme until it's fixed |
| Log says "Call to undefined function" | Code calling a function PHP removed | Update the plugin, or have a developer rewrite custom code |
| Log says "Allowed memory size exhausted" | PHP memory limit reached | Raise the memory limit in your host's PHP settings, or ask your host |
| Same error after switching PHP back | Something else changed, such as an automatic update | Restore your latest backup, then investigate |
The usual suspect is code that hasn't kept up. PHP 8.0, for example, removed functions older plugins relied on, including create_function() and each(), according to php.net's PHP 8.0 migration notes, and code that calls a removed function stops with a fatal error. Maintained plugins have already adapted, so updating usually solves it. Premium add-ons update through the vendor, often only while your license is active, so update the add-on and its main plugin together. Custom snippets in a child theme's functions.php or in wp-content/mu-plugins never update themselves and need rewriting.
Owner-level steps fix most cases. Bring in a developer, or a team that builds and maintains WordPress sites, when:
A PHP update shouldn't be a gamble. Before the next one:
If your site is down right now, start with the recovery email, or roll back to a patched PHP version. Once it's back, find the failing plugin and fix it properly so you can move forward to a supported version.
If you'd like a second pair of eyes first, send us your site and we'll record a free 2 minute video audit showing the 3 fixes we'd make first.
Usually, yes, if the error started right after the PHP change, because the plugin or theme that broke still works on the older version. Only go back to a version that's still supported and patched, such as PHP 8.2.35, 8.3.36, 8.4.27 or 8.5.12 or later, never 8.1 or older. Then fix the plugin, because PHP 8.2 support ends on December 31, 2026.
Check your spam folder, then check which address WordPress uses: the Administration Email Address in your General settings. If someone else set up the site, the email may have gone to them. WordPress sends this email at most once a day by default, so don't wait for another. Use your host's error log or the WordPress debug log to find the plugin instead.
No. The critical error means PHP stopped while building the page, not that anything was deleted. Your posts, pages, products, orders and settings live in the database and stay there. Once you deactivate or fix the plugin or theme that failed, or switch PHP back, the site loads normally again. Still, take a backup before you change anything else.
The quickest clue is the recovery mode email, which names the plugin or theme WordPress caught. If you don't have it, turn on the WordPress debug log and search wp-content/debug.log for "PHP Fatal error". The file path on that line, such as wp-content/plugins/plugin-name, tells you which one failed. Deactivate that plugin first, then check the site.
Only for a short while. Each PHP version gets security fixes for a fixed period, then none. PHP 8.2 stops receiving security fixes on December 31, 2026, and PHP 8.1 and older already get no updates from the PHP project. Staying behind leaves known security holes open, so treat a rollback as time to fix the plugin, not a permanent setting.
The 3 fixes we'd make first on your site, within 1 business day.