Websites and computers are fraught with issues. If you’ve ever had your computer come up with the Blue Screen of Death, you know what I’m talking about. Most people, when confronted with that error screen, just shut their machines down and take them to the nearest geek they know. Some of us are those geeks, and know how to read the information on the screen, and what to do about it. Did you know that different lines of code on that screen mean different things, and those codes indicate what error caused the computer to crash?
It’s not just operating systems and hard crashes that plague the computerized world. The Internet is, literally, nothing more than a massive collection of individual machines and lines connecting them, all running on a decades-old infrastructure with protocols that don’t always know how to handle everything that’s going on. Sometimes, when an error comes up, it’s a problem with a connection or a computer. Sometimes it’s a configuration error, or an error with a server.
One of the most common errors is the Internal Server Error.
There are a whole bunch of names you might see this under; 500 Internal Server Error, HTTP 500 Error, and more. It’s all the same thing, but you can only fix it if you’re the owner of the website and you’re capable of accessing and configuring said server.
The pesky part of the 500 Internal Server Error is that it can show up at any time and for any user. It doesn’t matter what operating system your users or your server is running, nor does it matter what device the user is using to browse. It can come up at any time.
The primary problem with diagnosing this error is what it means.
“Internal Server Error”? It’s really nothing more than “an error happened with the server.” There’s not really any information tied to the error message, at least not always. Sometimes, the server configuration gives a little extra indicator of the culprit, usually when the server is running a Microsoft IIS platform. You might see “500.19 – Internal Server Error” or something of that sort. In this case, the .19 is an indicator of what actually caused the error.
If you’re a user encountering this error on a website you know otherwise works, there are a few options you can try. They don’t always work, because the 500 error is almost always a server error, but in the rare case that a client-side issue occurs, you could fix it with one of these methods.
Unfortunately, as a user, virtually none of this is going to work. A 500 error is almost always a server-side error, and that means there’s not much you can do. If it’s just one page on a site, try using a cached version of it from Wayback Machine or Google. If it’s an entire website, the whole thing is probably down and site owner will need to address the issue. You can use Down For Everyone Or Just Me to check if the site is down in general or if it’s an issue with your computer.
One thing you might consider is trying to contact the owners of the site, particularly if the error is just on a single page. They might not know about the issue, and you informing them will help them get to work on fixing it.
If you’re the site owner, and you’ve been informed that your site is presenting Internal Server Errors to people, you have some work to do. Unfortunately, until the issue is fixed, no one will be able to use your website. Business is effectively dead in the water.
There are three primary root causes of the 500 Internal Server Error.
So how do you diagnose and fix these errors?
The first thing you need to do is determine if you’re running a content management system, like WordPress or Joomla. If so, good! You’ll be able to look into the specific steps for that CMS in order to fix the issue. I’ll give you an example of that later.
If you’re not using an off-the-shelf CMS like WordPress, you’ll probably want to talk to your web host. Dreamhost, Bluehost, Hostgator, 1&1; they all have instructions in their help centers to help you troubleshoot and fix a 500 Internal Server Error. If you can’t figure it out on your own, they probably have live support you can talk to via phone or web chat in order to find the cause of the error.
If you’re a coder and you’re using a CGI script or a Perl script, you’re going to want to troubleshoot it first. This is typically caused by syntax errors.
For some servers, a CGI script will need more than just an execute permission to run. It will also need ownership from the correct user and the correct group. This will vary from server to server, so try checking if you have another active CGI script that works, and copy the permission it has.
I mentioned before that when your server is running in a Microsoft IIS environment, it will produce more tangible information for the errors that come up with a 500 server issue. I’ll list what these are here.
Now, if your eyes glazed over when you read all of that, don’t worry; mine did too. I’m not an IIS certified IT professional, so I don’t know what most of that means. If you see one of those more specific errors, hand the issue over to your IT guy and let them figure it out.
If you don’t have an IT guy, or you’re determined to figure it out on your own, you can read more about the errors here. Just scroll down to “Common HTTP status codes and the causes” for more detailed information about each code.
Before we begin with fixing the error in WordPress, you need to know that the most up to date versions of WordPress – in other words, the ones you should be using to avoid security errors – need to be set to use PHP version 5.4 or higher. If your server is configured to use an older version of PHP, it will cause 500 errors. This is generally just a way for WordPress to prevent users from reaching a site filled with security exploits and issues.
Most web server environments will be running cPanel as the control panel software for things like PHP and WordPress. It’s in this panel that you change the version of PHP.
If you’re experiencing the issue with an Internal Server Error on WordPress, the first thing you need to do is check for a corrupted or invalid .htaccess file. The easiest way to do this is to log into your server via FTP and find the .htaccess file. Rename it – don’t delete it! – and try to load your site. If it works, your .htaccess file is causing the Internal Server Error.
If .htaccess was to blame, you’ll want to generate a new one. Go into your WordPress control panel and go to the Settings section. Find Permalinks and click the save button there. This will generate a new .htaccess file, and the old one can be safely removed.
The second most common cause in WordPress for the Internal Server Error is running into the PHP memory limit. This can happen if the limit is low, or if you have a lot of PHP running, or it’s running with a memory leak. You can experiment to discover if this is the issue by increasing the memory limit. This is pretty easy; just go to your wp-config.php file and open it up. You’ll look for the main PHP tag. Inside it, add
Now save it and test to see if you still get the error. If you do, either the problem is caused by something else, or the memory limit didn’t take. It’s possible that your web host will need to change their php.ini file to remove the limit. Contact them about the issue.
If you have access to that php.ini file, all you need to do is add the line memory=64MB to the file, and upload it to the wp-admin folder. Again, test your site, and see if it works.
If it works, you’ve found that the memory limit is the cause, but you haven’t fixed the problem. Something, like a poorly created script or a memory leak, is eating up your available memory. Try disabling plugins to see if one of them is causing the issue, or talk to your web host and ask them if there’s anything in server logs that indicates the cause.
If the PHP memory limit didn’t fix it, do the typical WordPress diagnostic step of removing all of your plugins temporarily. If your site works with no plugins, then one of the plugins – or the interaction between two of them – is causing the problem. Enable them one by one until you find the one that breaks your site, and ditch it.
If, after all of this, you still haven’t fixed the problem, you might have some core file corrupted. Get a fresh WordPress install and copy over the wp-admin and wp-includes folders. This will save your information and settings, but will replace WP files that have been changed or corrupted, to hopefully fix any problem.
If your site is still down after all of this, there may be something wrong with the physical hardware of your web host. Contact them and try to troubleshoot the problem.
There are other causes of the error, both on and off WordPress. That’s really the problem with such a pesky, generic error; it’s difficult to troubleshoot. Ideally, one of the steps above has solved it for you. If not, you’re going to need to talk to your IT guy and your web host, and see if they can access any more specific server logs to help you identify the cause. Good luck!
James is a content marketing professional who enjoys writing useful content for bloggers. He’s a contributing writer at Forbes, Entrepreneur, Inc, and Business Insider.