Sometimes WordPress just goes insane. It makes no sense at all. You’re plugging along, making posts, and then BOOM you get a 500 error. What’s worse is even though you set IIS to show 500 errors, it doesn’t tell you WHAT the error is. It just gives you a blank 500 page.
Here’s how to debug a 500 error in WordPress.
First, get access to your wp_config.php file in your main directory for WordPress. Whether you have to use FTP or remote desktop, get to edit it.
Add in these three lines:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_DISPLAY', false );
define( 'WP_DEBUG_LOG', true );
Save that file. If you’re using FTP, FTP it into place.
Now go and try your website again. It’ll probably show that 500 error again – but now at least you have a record of what’s going on.
Look into the directory wp-content. You should now have a file called debug.log.
Edit that file in a text editor.
You’ll now be able to see exactly where the error is happening. That will at least give you a starting point to google the error or to post about it in a support forum.
I’ll note that I just spent about a half-hour trying to track down a 500 error. It happened randomly, after I made a post to my blog. So it wasn’t even like I did an update and then POOF this error came about. There was no sign I’d been hacked.
Finally after getting nowhere with the generic function call that was generating the error, I rebooted my server. The error went away again. So also keep in mind that sometimes rebooting is a good solution.
Leave a Reply