CGI Quick Tips

Here are a few things you should check if you're having trouble running a CGI script.

1. Make sure that you set the proper permissions for your scripts. Users must be able to read and execute your script. To do this, first telnet to your domain, and then "chmod 755 filename", or by FTP if your FTP software allows it.

2. CGI scripts must have the extension of ".cgi" or ".pl" and not anything else.

3. Make sure you're placing your scripts into your "cgi-bin" directory.

4. If running a PERL script, then the first line must point to the location of our PERL interpreter.Perl4 (#!/usr/bin/perl) and Perl5 (#!/usr/bin/perl5). Some CGIs rely on Perl5, so that first line must point to the correct location.

5. Keep in mind that CGI is programming, and is a lot more involved than HTML. Buy the books you need to become familiar with CGI programming and whatever languages (Perl, C, etc.) you want to write them in.

6. Finally, make sure you upload your text scripts (like Perl) in ASCII file transfer mode, and not binary mode. This is true for any text file.