cgi-Bin 500 Internal Server Error

The "500 Internal Server Error" is likely to be the most common error message you will see while debugging your scripts. Unfortunately, it is also a very generalized error message, which reveals little other than that there is some problem with the script.

To locate the problem or problems, a systematic approach is needed. First and foremost, you should take care to always do the following: If you are uploading the script to your server via FTP, always make sure you have done so in ASCII format.

If your FTP client autodetects, make sure it knows that .cgi and .pl files are ASCII files. Uploading in BINARY format will cause problems.

Make sure the first line of your script is the path to Perl, and that it is correct.

It should look like:
which is the path to Perl 5.

If you are still getting the 500 error you can get the web server to send the reason for the error to your browser by using the CGI::Carp module.

Enter the line:
use CGI::Carp qw(fatalsToBrowser);
after the #!/bin/perl line.

When the script encounters an error, you will get a message like,
"Software error: Error description at line 6."
which will give you the location of the line containing the error.

Other points

When debugging a program you will generally need to place print statements in strategic locations, to see how the flow of the program is working. You might add one inside an if/then statement for instance, so that you can see if the statement is being evaluated as true or false.

Problems sending email from scripts

If your cgi scripts need to send email from the server they need to be configured to use the Easyspace mail program 'easymail'. The reason for this is that we do not support direct sendmail access.

This means that where your script requires the path to sendmail or $mailprog for easymail this should be entered as:

Easymail requires that a valid email address is submitted to make up the From: email header, if your script runs OK but no message is sent it will normally be because the email address used as the From: email address is not valid.

  • 0 brukere syntes dette svaret var til hjelp
Var dette svaret til hjelp?

Relaterte artikler

"550 5.7.1 ... we do not relay" Error

To be able to send (relay) mail over our network (without getting a "550 5.7.1 ... we do not...

Authorisation Error - cannot connect to server

This error message will be generated when the email server does not recognise the format of the...

Blocking Call Cancelled

This error message will appear when data has been stopped from being either uploaded or...


While our web servers are updated immediately, when you go to view your new web pages you may...

Email Error Messages

There are a number of resources for identifying what email error messages mean....

Powered by WHMCompleteSolution