Scripting:
How do I prevent the '500 Internal Server Error'
when running CGI scripts?
Syntax or coding errors in your CGI/Perl script
may produce an "Internal Server Error".
CGI Script Guidelines:
1. When editing your CGI script, use a program that
saves the file as a 'text file' type. DO NOT use
Notepad that comes with Microsoft Windows because
it doesn't save files in pure ASCII text format.
Use Wordpad instead to edit files.
2. Upload your CGI scripts in ASCII mode into the
cgi-bin directory.
3. Set the file permissions on the CGI script file
and directories to be 'chmod 755.' If you use an
FTP program to transfer files, right-click on the
file and select change file attributes. Using Ws_FTP
Pro, enter 755 under numeric value.
4. If you are still getting errors, you can instruct
the server to display any errors messages to the
web browser by adding the following line near the
top of the Perl script:
#!/usr/bin/perl
use CGI::Carp qw(fatalsToBrowser);
5. Double-check any changes you have made to the
script and also ensure the following line appears
after the perl path:
print "Content-type: text/html\nn";
6. Ensure that the perl modules you
require for your script is supported on the Skynetinfo
plan. For a list of the currently supported Perl
modules, please
click
here
|