500 Internal Server Error WordPress

500 internal server error wordpress

One of the most common (and most annoying) errors that PHP throws is the dreaded ‘500 internal server error’. WordPress is just as susceptible to this as any other PHP framework, but rest assured we’ve got the solution for you.  Keep reading!

NOTE – Before continuing, it’s important that you always back up your site before making any changes.

the 500 internal server error WordPress is a general error that can be caused by any one of numerous problems. Below, we’ll dig into common causes and their solutions to get your site running again now:

Enable Debugging

The most direct approach we can take is to enable debugging mode, and hope that WordPress is able to give us a more-specific error after that.

To do this, open up wp-config.php in the root folder of your WordPress install. Search for the following line:

define( "WP_DEBUG", true);

If this line is present, make sure the value is set to true. If you’re unable to locate this line, add it to the end of your wp-config.php on a new line and save.

Test again and see if the 500 error has disappeared or changed to a different error message. With any luck, you’ll have a new message pinpointing exactly what file / line the issue is on. Give this info to your developer if you’re unsure how to correct the issue.

If this fix didn’t solve your issue, proceed to the next solution below.

See if the Admin Panel Works:

For this test, visit http://yoursite.com/wp-admin and see if the page loads and you can log in.

If the admin panel does loads for you, we can conclude the issue is probably a plugin or your theme issue.

If the admin panel does not load for you, we’ll have to do some further debugging.

Plugin or Theme Issue

If the admin panel did load for you, we can be pretty sure that the issue is with a plugin or your theme. If you’ve just made any changes to either, try reverting back to how things were and see if this helps. Undo any code changes, deactivate any plugins you recently enabled, and if you just applied a theme, revert to the old one.

If you haven’t made any changes recently, try disabling all plugins or switching to the default theme. By switching themes and turning plugins on and off, you’ll often be able to deduce which plugin or theme is causing the issue.

Further Debugging

What if the admin panel didn’t load for you either? Here’s where we’ll delve deeper into possible fixes when neither the front-end nor the admin panel will load.

The best place to get find a readout of the exact error you’re experiencing is in the PHP error log. Since WP Debugging didn’t catch the error, we’re expecting that programming language interpreter did.

First, locate your PHP error log. It depends on your operating and web server, but common locations include:

  • /var/log/apache2/error.log
  • /usr/local/apache/logs/error_log
  • /var/log/httpd/error_log

Scroll to the bottom of the error log, looking for the most recent dates and times (they’ll be all the way at the bottom). Search for ‘fatal error’ and identify whether you’ve received any of those recently. You can even refresh the website, reload the log, and see if a new fatal error is appended to the log.

Fatal Errors are an indication that something is broken – if you’re seeing them, you’ll need to address the issue to get your site working again. Luckily, the file and line number will be indicated so you know exactly where the issue is. If you’re unable to resolve it yourself, give your web developer the error message and they’ll take care of it.

One reply on “500 Internal Server Error WordPress”