Blogathon 08/19: 500 Internal Server Error

Error messages that don’t actually tell you what the error is.

What’s the point of that?

I’ve been experiencing quite a lot of 500 Internal Server Error lately.

It crops up a lot in various WordPress and Drupal forums – it’s a particularly frequent little blighter against those two types of tech (but 500 Internal Server Error isn’t an exclusive error to WordPress and/or Drupal).

And because ‘500 Internal Server Error’ doesn’t give you any pointers as to what the problem is, or which part of the internet tech is at fault, the user is often left scratching their head (or backside) as to the cause.

Perhaps the most frustrating thing about ‘500 Internal Server Error’ is the fact that it usually only pops up on the Admin dashboards – seldom appears on the ‘public-facing’ webpages.

So here it is, kids, what ‘500 Internal Server Error’ actually means, where it originates, and how to fix the pesky little bleeder.

The root (ha ha ha ha ha – technical pun there) of ‘500 Internal Server Error’ is in the .php code that many websites are built on.

Let’s have a quick look at the Wikipedia entry for the 500-range of http status codes (the 500-range is specific to server conditions):

Response status codes beginning with the digit “5” indicate cases in which the server is aware that it has encountered an error or is otherwise incapable of performing the request. Except when responding to a HEAD request, the server should include an entity containing an explanation of the error situation, and indicate whether it is a temporary or permanent condition. Likewise, user agents should display any included entity to the user. These response codes are applicable to any request method.

https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#5xx_Server_errors

So what ‘500 Internal Server Error’ *actually* means is: ‘I’ve hit a problem. It’s a very big problem. It’s serious. I have no idea precisely what that problem is. But it’s a big serious problem. Therefore I don’t know what to suggest you do to fix it. Have a nice day.’ In a nutshell.

This kind of error message is marvellous. It’s straight out of the Douglas Adams/Hitchhiker’s Guide To The Galaxy book on helpfully vague error messages. If such a thing exists. Which it should do.

Anyway.

Because ‘500 Internal Server Error’ is an http status error message, and the 500-range are server-side notifications, it is safe to assume that this error message probably originates from the underlying .php code that most websites are written in in which most websites are written.

As ‘500 Internal Server Error’ is so effortlessly vague, the most common cause is the equally wonderfully vague .htaccess file.

Usually (again, but frequently in my experience) ‘500 Internal Server Error’ can often be made to varnish vanish through simple surgery on the .htaccess file in the root of the website.

How do you do this? Magic Simples.

You fire up your trusted ftp software (or use your website’s control panel and navigate to the root of your website in your File Mangler Manager. Find your .htaccess file and rename it to something cryptic such as .htaccess_old.

And then you log in to your website and Lo and Behold there are Three Wise Men Kneeling Around A Manger In Which A Virgin Has Just Placed Her Newborn Child you have vanquished and banished the ‘500 Internal Server Error’ for ever (perhaps).

Like I said, magic simples.

Bookmark the permalink.

4 Responses to Blogathon 08/19: 500 Internal Server Error

  1. Masher says:

    In the words of Oliver Hardy: I have nothing to say.

  2. Allister says:

    If you’re rolling your own PHP, as I have been at work, another cause can be a single missing bracket, quote, or semicolon. Those semicolons are the worst. Something so small should bloody well be where I think it should be cos I’m not gonna notice it of my own accord.