How to trace what is causing WordPress error 500?
12,920
Turn on php errors in your php.ini or add this line to your .htacess file in your webroot:
php_flag display_errors on
Author by
TruMan1
Updated on July 19, 2022Comments
-
TruMan1 almost 2 years
Internal error 500 is such a general error and nothing shows up in the logs under /wordpress/error_log. Is there a way to get a stack trace of where the crash is occurring? In ASP.NET it is so easy because a stack trace, code snippet, and line number all show up in the error page. Any help would be greatly appreciated.
-
Bill over 9 yearsDone both of these things and I still have no errors, just a default "Internal Server Error" page served up by my web browser.
-
Mark almost 7 years@Bill (or anyone else coming along) - WordPress does funny stuff with error reporting based on constants. Look into the
WP_DEBUG
,WP_DEBUG_LOG
, andWP_DEBUG_DISPLAY
constants. For example in 4.7.3, WordPress will explicitly turn offdisplay_errors
, overriding your environment settings, if you haveWP_DEBUG
on but notWP_DEBUG_DISPLAY
. -
Mark almost 7 yearsBy contrast,
WP_DEBUG_LOG = true
will cause WordPress to clobber yourerror_log
setting, pointing it to wp-content/debug.log instead, whereasWP_DEBUG_LOG = false
(or omitted) will leave yourerror_log
andlog_errors
alone.