CGI FAQ List
Topics
- What is a CGI?
- Commonly used languages
- Unsupported development mechanisms
- Location of commonly used utilities
- What does Permission Denied mean?
- What does Malformed Header mean?
- Where can I find the error logs for my CGI?
- Where can CGIs be run from?
- What will the URI for my CGI be?
- CGI-bin and web-hosted domains
- How do I get CGI help?
Answers List
What is a CGI?
The Common Gateway Interface (CGI) is a mechanism for sending information from an end-user's web browser to a program on the web server. CGI also allows for the program's output going back to the end-user's web browser for display.
Common usage for the term "CGI" is in reference to a program that takes input from a web browser and does something with it. Common uses for CGIs include web guestbooks, search engines, and shopping cart software.
Commonly Used Languages
There are a number of languages that can be used to write a CGI. The following are some of the more popular languages that our web servers support.
Perl
Perl is a widespread scripting language that has rather firmly entrenched itself into the internet. Our web servers run Perl 5.005_02 (view full info). The Perl interpreter itself is located at /usr/local/bin/perl
PHP
PHP: Hypertext Preprocessor (PHP) is used as an alternative to Microsoft's Active Server Pages (ASP) technology. Our webservers use PHP version 4 (view full info) with the interpreter located at /usr/bin/php
PHP 5 is available (view full info), though it is not used as the default interpreter. Please see our PHP 5 document for more information.
Python
Python is a strongly object-oriented programming language that is becoming increasingly popular with web programmers. Our webservers use Python version 2.3.4 with the interpreter located at /usr/bin/python
C/C++
One of the most broadly-used programming languages of all time, programs written in C or C++ are most often compiled into self-sufficient executable files.
Unsupported development mechanisms
The Sonic.net webservers do not support CGI-style programs written in the following formats:
- Microsoft Active Server Pages (ASP)
- Java Server Page (JSP)
- Cold Fusion
Location of commonly used utilities
What does Permission Denied mean?
Permission Denied is an error that is triggered when a program tries to do something it is not allowed to, or when a web browser requests a file that it is not allowed to use
If you are getting this message on a page or script that you own, then you probably need to change the permissions on that file. Just login to your shell account and do the following:
- type:
cd /path/to/file/ - then type:
chmod 755 filename - then:
exitto leave the shell.
Most Mac and Windows FTP programs will allow you to change file modes (permissions) as well, so shell access is not strictly required to modify permissions.
Advanced information on Modes.
- type:
What does Malformed Header mean?
A malformed header is a general error that means that your CGI did not execute properly. This can be caused by an improper type declaration in your program's output, or even by a syntax error in the program itself.
Missing semicolons and incorrectly uploaded files are common culprits. Double-check the source code for errors and try again.
Where can I find the error logs for my CGI?
The error logs for each of our web servers are located at
/var/log/custweb/error.log. Inspecting the error logs can be very helpful in tracking down the causes of CGI problems in general.Where can CGIs be run from?
/home/WWW_pages/username/
This is your default web directory, where your HTML and image files are likely to be located.
What will the URI for my CGI be?
Files in your default web directory will be accessible on the web at http://username.users.sonic.net/filename
CGI-bin and web-hosted domains
If you have a web-hosted domain name, any requests for the "cgi-bin" or "cgi" subdirectory will be directed to content in /usr/local/lib/httpd/cgi-bin/ instead of your normal web content. This is an artifact of an older web cluster configuration left in-place to support legacy web sites.
How do I get CGI help?
You can start by posting your questions to the sonic.help.cgi newsgroup.

