How to Fix WordPress Critical Errors After a PHP Upgrade
Upgrading your site’s PHP version (for example, moving from PHP 7.4 to PHP 8.x) is essential for security and speed. However, it’s not uncommon to hit a snag immediately after an upgrade, such as seeing the dreaded message:
“There has been a critical error on this website. Please check your site admin email inbox for instructions.”
Don’t worry! This almost always means an older plugin or theme on your site isn’t fully compatible with the newer PHP version yet. Here is a step-by-step guide to diagnosing and fixing the issue.
🔍 Why Does This Happen?
Newer PHP versions remove outdated code functions (called “deprecated functions”) and enforce stricter security rules. If a plugin or theme installed on your site was written using older code, it can trigger a fatal script error when run under a newer PHP version.
🛠️ Step-by-Step Troubleshooting Guide
If you lose access to your site or wp-admin dashboard after a PHP upgrade, you can easily troubleshoot using cPanel File Manager.
Step 1: Temporarily Roll Back PHP (Quick Recovery Check)
If your site is live and you need it back online instantly while you troubleshoot:
- Log in to cPanel.
- Go to Select PHP Version (or MultiPHP Manager).
- Switch your site back to the previous PHP version (e.g., PHP 7.4).
- Save changes. If your site loads again, you know with 100% certainty that a plugin or theme compatibility issue is the cause.
Step 2: Enable WP Debug Mode to Identify the Bad Plugin
To see exactly which plugin is failing, turn on WordPress debugging:
- In cPanel, open File Manager and navigate to your site’s root directory (
public_html). - Right-click the
wp-config.phpfile and select Edit. - Find the line that says:
define('WP_DEBUG', false); - Change
falsetotrue, or add these lines right above/* That's all, stop editing! */:define('WP_DEBUG', true); define('WP_DEBUG_LOG', true); define('WP_DEBUG_DISPLAY', false); - Refresh your broken website page, then open the newly created
debug.logfile located inside the/wp-content/folder in File Manager. Look at the bottom lines for a path pointing to a specific plugin (e.g.,/wp-content/plugins/plugin-name/).
Step 3: Deactivate the Problematic Plugin via File Manager
Once you know which plugin is causing the issue:
- In File Manager, navigate to
public_html/wp-content/plugins/. - Find the folder of the incompatible plugin.
- Rename the folder by adding
_oldor_disabledto the end (e.g., renamebad-plugintobad-plugin_disabled). - Switch your PHP version back to the newer version in cPanel.
Renaming the folder forces WordPress to safely deactivate the plugin, allowing the rest of your site and admin dashboard to load normally.
🚀 When to Contact Support
If you’ve checked your error logs in File manager, debug logs, disabled your plugins, and still see a critical error—or if your site is mission-critical and you need an engineer to assist—we’re happy to help!
When opening a ticket at my.cloudabove.com, please let us know:
- Your Domain Name.
- The target PHP version you are trying to upgrade to.
- Any error messages listed in your
debug.logor error logs.
🛡️ Prevention Tips for Future Upgrades
- Update everything first: Always update WordPress core, all plugins, and your active theme to their latest versions before upgrading your PHP version.
- Test on a Staging site: If your hosting plan includes a staging environment, test the PHP upgrade there first to catch any errors without affecting your live site.