The most common problem that people have with cgi scripts is the
permissions on the script. In order for a script to run, it must have execute
permissions. If you are getting this error:
ForbiddenYou don't have permission to access
/cgi-bin/test.pl on this server. |
You need to change the permissions to '755'. You can do this with most ftp clients, or
through telnet.
The next most common problem is the 'mode' that you upload the script in. (i.e., from your
editor to the server). You need to configure your ftp client to upload ".cgi"
and ".pl" files in "ASCII" mode. The error you will recieve if you do
not upload in ASCII mode is:
Internal Server ErrorPremature end of script headers:
/home/you/cgi-bin/script.cgi |
1. Log into your account through telnet, rlogin, or ssh. (see above)
2. Assuming your script is in 'cgi-bin', type "cd www/cgi-bin", hit enter.
3. Type "perl scriptname.cgi" where 'scriptname.cgi' is the name of the script.
4. Perl will tell you what is wrong with the script. Make the recomended changes.