Why is my CGI / Perl-scripts not working?


EXPERIENCING PROBLEMS WITH OUR SERVICES? RUN A DIAGNOSE FIRST TO SAVE YOURS AND OUR TIME

Added: 21.03.2011 15:27:12     Last updated: 21.03.2011 15:27:12

The first thing one should do is to make sure the sciprts has the correct access permissions. Most of the CGI and perl scripts should have permissions 755. The permissions can be changed via FTP, File manager or alike.

If you are still seeing an 500 Internal server error you should check is there is an error in the code. This can be done by running the following command via SSH:
-perl -w yourscript.pl
(where yourscript.pl is the filename of the script)

The command will show any warnings.

If the command does not give any warnings, but you still experience a 500 Internal server error in the web browser, the error is likely caused by the script not sending correctly Content-type line to the web browser. This can be fixed by adding a line in the script near the top:
print "Content-type: text/html";