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.

Was this answer helpful?

 Print this Article

Also Read

I have created an FTP user and was able to login but user can't see the home directory in FTP window. Also the user could not transfer files over. What may be the reason?

Cause: New FTP users can not FTP to the Website unless they provide the website name as Remote...

Authorisation Error - cannot connect to server

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

Troubleshoot 550, 553, and relay-prohibited errors [ Outlook ]

Troubleshoot 550, 553, and relay-prohibited errors Applies to...

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...

Junk Mails in Hotmail & Yahoo

Due to current virus mails, many of the mail address have been used in those mails even the...

Powered by WHMCompleteSolution