Skip to content

How To Resolve 500 Internal Server Error

January 12, 2008

The part about developing applications that I hate most is the troubleshooting part because it is the most tedious and the largest timesink. Unhelpful error messages and a lack of logs make it worse. If you develop applications then one of the first things you’d want to do is to have a proper logging system because only then will you be really able to track down what went wrong and fix it.

The worst kind of errors are those generic errors, which don’t even tell you what sort-of went wrong. No line numbers, no exception triggered in particular, etc. If you miss out a curly brace in JSP for instance, you get a try-catch exception error that will totally veer your troubleshooting efforts in the wrong direction unless you’re pretty clear with your code.

Speaking about web applications, the 500 Internal Server Error is a dreaded error message too.

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

If you get a 500 Internal Server Error, don’t go poking around your source code as yet. It might be something else, like a misconfigured web server, or simply the wrong file permissions, or the wrong web user or file owner. That’s what happened to me — I spent a good 15 minute or so looking through the file’s sourcecode before it hit me that it could be something else entirely.

I should have thought about that earlier because nothing changed, code-wise. It turned out that the folder that the script resided in had the wrong user/owner assigned. So I deleted that folder, and used FTP to reupload it, and viola — it works!

Related Posts.