2

I'm getting the error: 'There has been a critical error on your website. Learn more about debugging in WordPress.'.

How do I display which error I'm getting in the frontend?

I have these three lines in my wp-config.php-file:

define( 'WP_DEBUG', true );
define( 'WP_DEBUG_DISPLAY', true );
define( 'WP_DEBUG_LOG', true );

It surprises me that enabling WP_DEBUG, doesn't show it. I can (however) still find the errors in /wp-content/debug.log, - but it's just an extra step in development, having to open that file and find the error.

How do I just get the proper error displayed on the page, - and not hid away in that debug.log-file?

I can see that WP_DEBUG is enabled, since this:

echo '<pre>';
print_r( WP_DEBUG);
echo '</pre>';
die();

... returns: 1.

1 Answer 1

1

Ahh! I found it.

If I did this:

phpinfo();
die();

Then I could see that 'display errors` was set to off.

So if I added this in the top of my functions.php: ini_set('display_errors', 1);, then it started showing the errors.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.