Online Manual

CGI Troubleshooting

When I activate my CGI program, I get back a page that says
"500 Internal Server Error. The server encountered an internal error or misconfiguration and was unable to complete your request."

Perl scripts are ASCII text and must be transferred in ASCII mode. It's almost certain you uploaded the script from your PC or Macintosh in binary mode.
(Perl scripts however require ASCII, so are shell scripts and any other kind of script that starts with '#!' on the first line.) Assuming you don't have any legitimate carriage returns in the program (doubtful), it will fix the error by uploading your script again in ASCII mode.

If you still get the error, this is generally caused by not setting the permissions properly (CGI scripts need executable permission!!) or a problem within the script.
If you have verified your permission settings and everything is ok with them, connect to your shell account through SSH and test your script in local mode to get a better idea of what the problem is. To do this, go into the directory in which your script is located, then execute the script. To execute the script, you can do it by two ways:

1) Type "perl myscript.pl" (Perl being the language interpreter in this case).

2) Or simply type "myscript.pl" alone, that will work if the first line is well written to indicate the location of Perl.

The first one is useful to see if there's any error IN your script. The second one is useful to test if your "calling line" (the first line of the script) is okay, i.e. if you entered the right location of Perl.

 

Return To Menu

- Last modified on 3/16/2003 -


Home / Hosting / Domain Lookup / Support / Email Contact

© 1998-2025 Spunkyworld Internet Services - All rights reserved