Click here to visit our Sponsor

CGI Common Problems & Frequently Asked Questions


Below are links to some of the more commonly asked questions regarding CGI problems & errors.

How do I change file permissions through FTP?

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

  1. On the "Remote" window of WS_FTP, locate your cgi file and highlight it.
  2. Right click somewhere in the "Remote" window, and select chmod (UNIX) in the resulting menu.
  3. Select the appropriate permissions and click OK
    The following permissions are to make a cgi program executable:

If the chmod was successful you'll see a message in your commands window that looks like the following: 200 CHMOD command successful. Macintosh

  1. Choose the file.cgi
  2. Choose the REMOTE|SET PERMISSIONS
  3. Choose the appropriate permissions

NOTE:
The required permissions for a cgi script are rwxr-xr-x (chmod 755).


What's the FULL/COMPLETE PATH for files in my account?

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";


Where is XXXXX located on the server?

The following are the locations of some commonly used programs in CGI scripts:


What should the first line read in my PERL script?

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


[an error occurred while processing this directive]
I cannot get exec cgi= to work.

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


Server Error- The server encountered an internal error...

#1 Cause Of This Problem:

Your cgi program failed to execute because of errors in the cgi program itself.
You can check your script for errors with our "PERL Script Check" located in your console


OTHER POSSIBLE CAUSES FOR FAILURE:


If your script outputs HTML, then it must output a properly formatted header before any html. A properly formatted header consists of the line:

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";


How do I check my PERL scripts for errors.

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

 

Back to Index