I recently re-did my local dev setup and have been seeing these types of fatal error warnings:
There has been a critical error on this website. Please check your site admin email inbox for instructions.
Learn more about troubleshooting WordPress.
When I disable the "fatal error catcher" of WP like below to get the actual debug trace of the error I am not seeing anything logged or rendered. I am seeing other error_log(..)
entries appearing in /wp-content/debug.log
.
wp-config.php:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', true );
define( 'WP_DISABLE_FATAL_ERROR_HANDLER', true );
From phpinfo()
it shows display_errors
as On
(so not the same issue as in this questions).
How can I get to see the debug trace of those fatal errors?
wp-content/debug.log
? Your host can point you towards it if you're not sure where that isdebug.log
— just the Fatal ones show up nowhere.php.ini
is configured to log to an error log. Also errors don't just randomly occur like this, they always have a cause and pattern, so narrowing it down further will be important$ php -i
I get php -i | grep "log"`error_log => no value => no value
andlog_errors => On => On
, viewingphpinfo()
output in the project I haveerror_log
pointing to the local/wp-content/debug.log
file of that project.debug.log
, which is suboptimal. It means anything that fails before the WP error handler is added is not logged or caught becausecontent/debug.log
has not been set yet. You also have the problem that if your error reporting level is weird it may not log certain types of error at all. Likewise if you use@
a lot,@
does not fix errors, it silences them, the error still happens. I don't think this is necessarily WP specific and you're shooting yourself in the foot by looking only in WP circles. It's generic PHP