Below are links to some of the more commonly asked questions regarding CGI problems & errors.
Changing file permissions depends on the FTP program that you are using. We'll describe methods with several programs, on several different operating systems. If you still require assistance after having tried the following, send email to help@megaton.net. MS Windows, Windows-95, Windows-NT
Owner | Group | Other |
---|---|---|
* Read | * Read | * Read |
* Write | _ Write | _ Write |
* Execute | * Execute | * Execute |
If the chmod was successful you'll see a message in your commands window
that looks like the following: 200 CHMOD command successful.
Macintosh
NOTE:
The required permissions for a cgi script are
rwxr-xr-x
(chmod 755).
Many PERL programs found on the internet require that you give a fully qualified
pathname to files in your account. For example, the configuration of a counter
script may require knowing the exact path of its datafile on the server.
It is a common mistake to just put /cgi-bin/ since that is the home of your
account, however, the TRUE directory is very different. We have set up a
local environment variable (DOCUMENT_ROOT) to make it easy to refer to your
accounts home directory. To refer to this variable in your PERL scripts,
simply use $ENV{'DOCUMENT_ROOT'}
wherever the complete
path to your home directory is required. The following line (taken right
from a working cgi program) will demonstrate the appropriate use of this
variable.
$pathtocounter="$ENV{'DOCUMENT_ROOT'}/counter/counter.txt";
The following are the locations of some commonly used programs in CGI scripts:
Either of the following will work as the first line of your PERL script:
#!/usr/bin/perl
This will now take you to Perl 5.03. Please note that many Perl modules are
not available for
Perl 5.03 ( CGI.pm, for example)
or #!/usr/local/bin/perl
The correct path to Perl 5.04_4 ( the most current stable version as of 8/27/98,
and the
version for which we have installed recent Perl modules) on our system is
now
/usr/local/bin/perl. All scripts should therefore begin: #!/usr/local/bin/perl
For security reasons, we have disabled
on our server. As an alternative, you may use
instead, it will work the same.
**NOTE** All pages using include virtual must end in .shtml or they will not appear correctly through the browser
#1 Cause Of This Problem:
Content-Type: text/html
Followed by two (2) carriage returns. In PERL this could be accomplished with the following code:
print "Content-Type: text/html\n\n";
You can check your PERL script using our "PERL Script Check" utility in your console.
How do I run SSI's?
You will need to add the following line to your html documents:
<!--#include virtual="/cgi-bin/script.cgi" -->
script.cgi would be the actual name of the script you want to run. The name of your page will also have to end in .shtml