Below are links to some of the more commonly asked questions regarding CGI problems & errors.
- How do I change file permissions? (chmod)
- What's the FULL/COMPLETE PATH for files in my account?
- Where is XXXXX located on the server?
- What should the first line read in my PERL script?
- I get: [an error occurred while processing this directive]
- I cannot get exec cgi= to work.
- How do I run SSI's?
- Server Error- The server encountered an internal error...
- How can I check my PERL scripts for 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@webstorage.com.
MS Windows, Windows-95, Windows-NT
- For Windows we recommend the FTP client WS_FTP (WS Ftp Home Page).
- On the "Remote" window of WS_FTP, locate your cgi file and highlight it.
- Right click somewhere in the "Remote" window, and select chmod (UNIX) in the resulting menu.
- Select the appropriate permissions and click OK
The following permissions are to make a cgi program executable:
| 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
- For Macintosh we recommend Fetch available at many Mac ftp sites including:
- Internet Software For The Macintosh
- Choose the file.cgi
- Choose the REMOTE|SET PERMISSIONS
- Choose the appropriate permissions
NOTE:
The required permissions for a cgi script arerwxr-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:
- /usr/local/bin/perl
- /usr/lib/sendmail
- /bin/date
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/perlThis 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/perlThe 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
- exec xxx=
on our server. As an alternative, you may use
- include virtual=
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:
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.
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
© 1997-2000 Internet Quality Services Corporation. All rights reserved.