How to Fix 500 Internal Server Errors in WordPress

Posted on Aug 22 2016 by in Blog 

Solutions that work How to fix 500 Internal Server error in WordPress

HTTP 500 Internal Server Error: It’s a nightmare, and it’s not exclusive to WordPress users. Also, it’s not the end of the world, so relax and we will give you solutions to fix your issues?

I have fixed my fair share of 500 internal server errors on various WordPress installs. Somehow, despite the fact that it’s an extremely common and easy fix, people still get worked up about it.

Well, I’ve had enough of that. In this post, I’ll explain, to non-coding, everyday WordPress users what exactly you’re up against while faced with this error, how it’s caused, and how to resolve it.

The Error:

It looks something like the following message set against a background of nothing at all. As you visit your website URL, you see a giant message slapping you in the face with the following message (or something similar):

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request…

Potential Causes:

As I mentioned before, 500 Internal Server Error is not limited to WordPress. But since we’re covering WordPress solutions here, there are a handful of reasons, any one of which could have caused the error:

  • Corrupted .htaccess file
  • Corrupted WordPress core files
  • Compatibility issue with plugin(s) or theme
  • Exceeded PHP memory limit

In the following bit, I’ll explain how to identify the cause and resolve the error:

Solution:

  • Corrupted .htaccess:

Since this is by far the most common cause of internal server error (on WordPress or any other website), it makes sense to begin your investigation/repair job with this one.

To do that, simply login to your FTP client and find the .htaccess file in the same path that contains other key WordPress installation folders (wp-content, wp-includes, etc.).

Rename the .htaccess to something (anything else).

Now revisit your website URL. If the problem is fixed, your (former) .htaccess file was corrupted. You can generate another with easily by going to admin dashboard, Settings >> Permalinks. Change the custom URL settings, click save, and then revert back to your previous settings. Click save and exit. Doing this generates a new .htaccess file for your website.

 

  • Allowed memory size exhausted:

You are receiving the internal server error message while trying to access your admin login page or uploading an image in wp-admin. This could mean you are overstepping the PHP memory limit.

Typically, a WordPress website runs on 32 MB of allocated PHP memory, which can be exhausted in a jiffy if you have a lot of scripts running and receive medium to high traffic. First check with your web host to ensure you are permitted to increase the allocated memory size.

Next, create a .txt file and name it php.ini. Paste the following code in it:

memory=64MB

Save this file and upload it to your WordPress installation directory (in path /wp-admin/folder) through FTP.

Note that this is a patch job for the duration it takes for you to find out what’s eating up all the memory. It could be a plugin/theme/widget/script. Ask your WordPress development company or web host to go through the server logs and find-destroy/fix the culprit.

 

  • Plugin/Theme Compatibility:

If your internal server error message is not limited to wp-admin, you have a run of bad luck. It’s not that the problem can’t be fixed, but it’s likely that the cause is a compatibility issue between plugin(s) and/or theme. Solving this is, quite honestly, bit tedious. So prepare yourself for the grunt work.

If you can access your admin dashboard, go there and deactivate all plugins.

If you can’t access your admin dashboard, go to your FTP client and to path /wp-content/folder. Rename the subfolder named ‘Plugins’ to ‘Stupefied_plugins’ or anything else.

You’ll be able to access your admin login (and dashboard) now if the issue was indeed with plugin compatibility. Once you get to the dashboard, go back to FTP >> /wp-content/folder, and revert your plugin folder’s name to ‘plugins’.

Back in admin dashboard, all your plugins will now appear deactivated. Activate them one-by-one, and keep checking your URL every time. The moment the error reappears, you have found the culprit.

Delete the offending plugin or contact the plugin author to resolve this issue.

If this fails to work then just,

  • Re-install WordPress:

Corrupted core files or entire directories like wp-admin and/or wp-includes could be the cause of trouble. You can simply replace these by downloading-installing WordPress again and uploading the same folders from new install to the old one. No, this will not result in any loss of your theme/plugins/content/other data.

 EndNote:

Usually, one out of four fixes work like a charm. But if that doesn’t cut it for you, call your web host to resolve the issue as quickly as possible.

Author Bio: Tracey Jones is a complete professional who has been working as a front-end WordPress developer for a Custom WordPress development company called HireWPGeeks Ltd. She also happens to be an enthusiastic blogger who loves to share her knowledge with readers.