Your CGI script gives you a
Follow the checklist given in the discussion. It’s aimed at a Unix audience, but the general principles embodied in the questions apply to all systems.
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, 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.
Make sure the script can be identified as a script by the web server.
Most web servers have a system-wide
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
.plx. Some servers have options to permit access
via the GET method alone, and not through the POST method that your
form likely uses. Consult your web server documentation,
configuration files, webmaster, and (if all else fails) technical
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 ...