How to debug 500 Internal Server Error in ASP
Posted by Helpdesk Admin on 09 April 2010 02:28 AM
|
|
If you are using ASP scripts you will at some stage come across the dreaded 500 Internal Server Error page. In the vast majority of cases this does not mean that there is anything wrong with the web server itself. This message is displayed by default when an ASP script generates an error for any reason, but the actual underlying error message is not displayed. Common reasons for this error include syntax errors in your script, database connection string errors, file permission errors, etc etc. There are a number of ways to detect and display the underlying error, but the quickest is to create an error handler page that is called by IIS when an error is encountered. To generate a custom error handler 1) Save the following script as "asperr.asp" in the wwwroot directory of your webspace : <% 2) Configure this as the Error 500 handler on your site:
3) Generate the error - the underlying ASP error message will now be displayed. Important: This method should only be used while developing and testing your website. You should remove this error handler and revert to default behaviour in a production website as full error messages can divulge information useful to someone attacking your website. Alternatively, you could modify this script to silently log errors and/or email them to the webmaster. Happy debugging! | |
|