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 Users Found This Useful
Was this answer helpful?

Related Articles

HT Access Error causes

If some files or folders that FrontPage needs in order to work are deleted you will get this...

Error 405 Method Not Allowed

If submitting a form results in the following error: HTTP Error 405 405 Method Not Allowed this...

Internal clients cannot use Internet Explorer to access FTP sites

SYMPTOMS When you use Microsoft Internet Explorer to try to access a File Transfer Protocol...

I get a IISPassword error HTTP ERROR 500 when I try to view my site.

The reason you are seeing this is generally because you have a .htaccess file in your directory....

Outlook No, Socket Error: 10060, Error Number: 0x800CCC0E

  Error: The connection to the server has failed. Account: 'youraccount', Server:...

Powered by WHMCompleteSolution