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
Share:
12,920
TruMan1
Author by

TruMan1

Updated on July 19, 2022

Comments

  • TruMan1
    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
    Bill over 9 years
    Done both of these things and I still have no errors, just a default "Internal Server Error" page served up by my web browser.
  • Mark
    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, and WP_DEBUG_DISPLAY constants. For example in 4.7.3, WordPress will explicitly turn off display_errors, overriding your environment settings, if you have WP_DEBUG on but not WP_DEBUG_DISPLAY.
  • Mark
    Mark almost 7 years
    By contrast, WP_DEBUG_LOG = true will cause WordPress to clobber your error_log setting, pointing it to wp-content/debug.log instead, whereas WP_DEBUG_LOG = false (or omitted) will leave your error_log and log_errors alone.