Since WordPress version 5.2 – in the case of fatal errors in your code – the scary WSOD (white screen of death) was substituted with a more elegant page with an error message “The site is experiencing technical difficulties”.
This kind of errors usually depend on some plugin which is incompatible with another one or a missing dependency on your server. It can also be related to your memory_limit setting in php.ini, where the default value of 128M is not sufficient for your website.
If you experience this error and you google for it, you can find many tutorials on how to fix the error. It basically involves adding these lines to your wp-config.php:
define('WP_DEBUG', true); define('WP_DEBUG_LOG', true); define( 'WP_DEBUG_DISPLAY', false );
And then looking for PHP errors in the wp-content/debug.log file.
In my case I had an error, I saw the message, but nothing showed up in the debug log. Also I had nothing in Apache logs.
I digged into the WordPress code and saw that the message “The site is experiencing technical difficulties” is shown in the wp-includes/class-wp-fatal-error-handler.php.
There I found an interesting part of code that lets you customize how the error will be shown to the user. You should create a file named php-error.php inside the wp-content directory. In my case the file content is very simple:
<?php print_r($error); ?>
In this way I could see what the actual error was and I was able to solve it!
Do you need help with your WordPress site? Please have a look at my WordPress services.