19.3.3.1. Make sure the web server can run the script
Check ownership and permissions with ls -l. The
appropriate read and execute bits must be set on the script before
the web server can run it. The script should be readable and
executable by everyone (or at least by whomever the server runs
scripts as). Use chmod 0755 scriptname if it's
owned by you, or otherwise chmod 0555 scriptname
if owned by the designated anonymous web user, assuming you are
running as that user or the superuser. All directories in the path
must also have their execute bit set (most FTP clients support
changing protections on uploaded files if you don't have shell access
to your server).
Make sure the script can be identified as a script by the web server.
Most web servers have a system-wide cgi-bin, and
all files in that directory will be run as scripts. Some servers
identify a CGI script as any file whose name ends in a particular
extension, such as .cgi or
.plx. Some servers have options to permit access
via the GET method alone, not through the POST method that your form
likely uses. Consult your web server documentation, configuration
files, webmaster, and (if all else fails) technical support.
If you're running on Unix, do you have the right path to the Perl
executable on the #! line? The
#! line must be the first line in the script; you
can't even have blank lines before the #! line.
Some operating systems have ridiculously short limits on the number
of characters that can be in this line, so you may need to make a
link (e.g., from /home/richh/perl to
/opt/installed/third-party/software/perl-5.004/bin/perl,
to pick a hypothetical, pathological example).
If you're running on Win32, have you associated your Perl scripts
with the correct Perl executable? Or, if your server uses
#! lines, have you given the correct path in the
#! line?