What's more frustrating than your sitting going down without you know why? So here's how to fix the WordPress error "The site is experiencing technical difficulties" problem that has confused many experienced WordPress users.
There is nothing worse when updating WordPress themes or plugins, to get the dreaded White Screen of Death!
No feedback, no down site messages, just a blank white screen!
You can click on the link above and read our post linked above for a good overview of what the White Screen of Death (WSoD) is (and how to fix it!)
Spoiler Alert! It is essentially a PHP "fatal error" that prevents WordPress from loading anything, not even time to show an error message
Well, the lovely WordPress developers have decided to do something about it.
The site is experiencing technical difficulties
Version 5.2 of WordPress and onwards tries to detect PHP errors that are the cause of WSoD.
The result is a new message "The site has technical difficulties".
It's much better than a blank screen, but it seems like many experienced WordPress users aren't aware of this new message yet.
Because who reads WordPress update blogs anyway, huh?
How to find the error
PHP is used in WordPress core, themes and plugins, so this doesn't really restrict things.
The best place to start is to put WordPress into debug mode and take a look at the log file it generates.
Put WordPress in debug mode
Locate your wp-config.php file so be able to put WordPress in debug mode.
The best solution will be to use File Manager in your cPanel or the equivalent in your hosting account.
The wp-config.php file should be located in the main hosting folder and contain the configuration settings for WordPress.
Add the following lines to the file, somewhere above the line / * That's all, stop editing! Happy blogging. * /
define ('WP_DEBUG', true);
define ('WP_DEBUG_LOG', true);
define ('WP_DEBUG_DISPLAY', false);
Once the lines have been added and the file has been saved, hit Refresh on any page on your site.
In File Manager, go to the / wp-content / folder and view the
Look in this file for a line that says "PHP Fatal Error:".
Here is an example of what you will see.
PHP fatal error: unable to declare bp_members_screen_display_profile () again (previously declared in /.../buddypress/bp-members/screens/profile.php:22) in /.../buddypress/bp-members/screens/profile.php on line 32
The line in debug.log will give you an exact file and the line number where the error occurred.
You can use it to identify if the error is in a WordPress plugin, theme, or core.
Clean up the debug code
Remember to remove the debug code lines from the wp-config.php file after you are done.
Alternative Fix Method
If the debugging method is too confusing for you to understand, there is another way to fix the error. It takes a little longer but it will work great.
Resolution of theme conflicts
Due to the error, you will not be able to log into the admin backend to change the theme.
You will need to do this using your hosting provider's file management system.
Find the current theme folder your site is using in / wp-content / themes and rename the directory with a later fix of "OLD".
For example, if your site uses the Divi theme, rename the "Divi" folder to "DiviOLD", then refresh the first page of the site that contains the error.
Don't worry, you won't lose any theme settings. They will be available when you restore the theme folder name at the end of this process.
Note: You will need to have at least one other default theme, such as Twenty Nineteen or Twenty Sixteen, in your themes folder for this to work.
If the error is still there after updating the site's front page, the error is not in the theme and you can rename the theme folder back to its original name.
If the error goes away and you see that your site is using one of the default themes, your theme contains the error.
You can now log into the admin area to update your theme or contact the theme developer or company for an update.
Resolving Plugin Conflicts
If the theme isn't the problem, it's likely a plugin's fault.
The quickest way to do this is to use the hosting account's file manager application.
Go to / wp-content / plugins and rename the "plugins" folder to "pluginsOLD".
Now update the site and log into the admin dashboard and go to the Plugins view.
You will notice that all plugins have been disabled because WordPress cannot find them because we have renamed the folder.
Go back to the file manager and rename "pluginsOLD" to "plugins".
Go back to the plugins view in the admin dashboard and refresh the view.
Now, start to activate each plugin one and a time, refreshing the homepage of the site until the error message appears again.
Bingo! The last plugin you activated is the one that has the error.
Now that you know which plugin is causing the issue you can reach out to the developer or company where you purchased it from for a patch, or in the worst-case scenario, find an alternative plugin.
Upgrading Your PHP Version
WordPress has increased the recommended version of PHP to version 7.2 and plugin and theme authors are taking advantage of the new functions available in PHP 7.
You may find that the PHP fatal error in the log file is generated because the old PHP 5.6 function doesn’t exist anymore.
This is called deprecation, where old functions are removed in favour of newer, better functionality.
It’s time to upgrade your PHP version from 5 to 7. You can also do this easily from cPanel.
If you don’t have access to cPanel, contact your hosting provider and they will help you to upgrade.
As of the time of writing, we recommend that you upgrade to PHP 7.3.
Once you have gone into the screen, you can choose which version of PHP to run as per below.
Disabling the Fatal Error (WSOD) Protection
If you are a developer and are looking for that additional granularity over the new PHP fatal error protection, you can disable it in a couple of ways.
- Edit your wp-config.php file and add the following line:
define( ‘WP_DISABLE_FATAL_ERROR_HANDLER’, true )
- In your theme’s functions.php file add the following line:
add_filter( ‘wp_fatal_error_handler_enabled’, ‘__return_false’ );
The second method returns false to the filter handler. You could also use the same function to parse the error output.
If you have followed the instructions here, hopefully, you will be back up and running and fixed the error: the site is experiencing technical difficulties.
Now is the time to make sure that your WordPress backups are running properly, just in case you need to use them as a last resort if this sort of stuff happens again!
Please leave a useful comment with your thoughts, then share this on your Facebook group(s) who would find this useful and let's reap the benefits together. Thank you for sharing and being nice!
Disclosure: This page may contain links to external sites for products which we love and wholeheartedly recommend. If you buy products we suggest, we may earn a referral fee. Such fees do not influence our recommendations and we do not accept payments for positive reviews.