[SOLVED] The site is experiencing technical difficulties

Here’s how to fix “The site is experiencing technical difficulties” WordPress error that has confused many experienced WordPress Users.

There is nothing worse when in the middle of updating WordPress themes or plugins, to get the dreaded White Screen of Death!

No feedback, no site down message, just a blank white screen!

Read my post linked above for a good overview of what the White Screen of Death (WSoD) is.

Spoiler! Essentially it’s a PHP “fatal error” which stops WordPress from loading anything.

Well, the lovely developers of WordPress decided to do something about it.

The Site Is Experiencing Technical Difficulties

WordPress version 5.2 tries to catch the PHP errors which are the cause of the WSoD.

The result is a new message “The site is experiencing technical difficulties”.

The site is experiencing technical difficulties WordPress error message

This is much better than a blank screen but it seems that a lot of experienced WordPress users are still unaware of this new message.

Who reads WordPress update blogs anyway, huh?

How to Find the Error

PHP is used in the WordPress core, themes and plugins, so that doesn’t narrow things down really.

The best place to start is by placing WordPress into debug mode and having a look at the log file it generates.

Placing WordPress in Debug Mode

Locate your wp-config.php file.

Your best bet will be to use File Manager in your cPanel hosting account, or equivalent.

The wp-config.php file should be in your root hosting folder and it contains the configuration settings for WordPress.

Add the following lines to the file, somewhere above the line /* That’s all, stop editing! Happy blogging. */

[pastacode lang=”php” manual=”define(‘WP_DEBUG’%2C%20true)%3B%0Adefine(‘WP_DEBUG_LOG’%2C%20true)%3B%0Adefine(%20’WP_DEBUG_DISPLAY’%2C%20false%20)%3B” message=”” highlight=”” provider=”manual”/]

Once the lines have been added and the file has been saved, hit refresh on any page from your site.

In File Manager, navigate to the /wp-content/ folder and view the file debug.log.

Look in this file for a line that says “PHP Fatal Error:”.

Here is an example of what you will see.

[pastacode lang=”markup” manual=”PHP%20Fatal%20error%3A%20Cannot%20redeclare%20bp_members_screen_display_profile()%20(previously%20declared%20in%20%2F…%2Fbuddypress%2Fbp-members%2Fscreens%2Fprofile.php%3A22)%20in%20%2F…%2Fbuddypress%2Fbp-members%2Fscreens%2Fprofile.php%20on%20line%2032″ message=”” highlight=”” provider=”manual”/]

The line in debug.log will give you an exact file and line number where the error occurred.

You can use this to identify whether the error is in a plugin, theme or WordPress core.

Clean Up Debug Code

Remember to remove the debug code lines from the wp-config.php file after you are finished.

The Alternative Fix Method

If the debug method it too confusing for you to wrap your head around, there is another way of resolving the error. It takes a bit more time but will work just fine.

Resolving Theme Conflicts

Because of the error you won’t be able to get into the admin back-end to switch themes.

You will have to do this using your hosting providers file manager system.

Find the current theme folder that your site is using in /wp-content/themes and rename the directory with a post-fix of “OLD”.

For example if your site is running the Astra theme, rename the folder “astra” to “astraOLD”, then refresh the front page of the site which has the error on it.

Don’t worry, you won’t lose all your theme settings. They will be available when you restore the theme folder name at the end if this process.

Note: you will need to have at least one other default theme, like Twenty Nineteen or Twenty Sixteen, in your themes folder for this to work.

If the error is still there after you refresh the font page of the site then the error is not in your theme and you can rename your theme folder back to its original spelling.

If the error disappears and you see your site using one of the default themes, then your theme has the error in it.

You can now access the admin area to update your theme or reach out to the theme developer or company for an update.

Resolving Plugin Conflicts

If the theme isn’t the problem then chances are it will be a plugin at fault.

The quickest way to do this is to use the hosting account file manager application.

Navigate to /wp-content/plugins and rename the “plugins” folder to “pluginsOLD”.

Now refresh the site and login to the admin dashboard and navigate to the Plugins view.

You will notice that all the plugins have been deactivated because WordPress can’t find them as we renamed the folder.

Go back to 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 front of the site until the error message appears again.

Bingo! The last plugin you activated is the one that has the error.

Now 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 any more.

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 and 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, I recommend that you upgrade to PHP 7.3.

cPanel Select PHP Version
Update PHP version to 7.2

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.

  1. Edit your wp-config.php file and add the following line:
    define( ‘WP_DISABLE_FATAL_ERROR_HANDLER’, true )
  2. 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.

Conclusion

If you have followed the instructions here, hopefully, you will be back up and running.

Now is the time to make sure that your backups are running properly, just in case you need to use them as a last resort if this sort of stuff happens again!

Was this article helpful?
YesNo