Printer Friendly
Dictionary, Encyclopedia and Thesaurus - The Free Dictionary
3,586,412,874 visitors served.
forum Join the Word of the Day Mailing List For webmasters
?
Dictionary/
thesaurus
Medical
dictionary
Legal
dictionary
Financial
dictionary
Acronyms
 
Idioms
Encyclopedia
Wikipedia
encyclopedia
?

common gateway interface

   Also found in: Acronyms, Wikipedia, Hutchinson 0.01 sec.
common gateway interface [‚käm·ən ‚gāt‚wā ′in·tər‚fās]
(computer science)
A protocol that allows the secure data transfer to and from a server and a network user by means of a program which resides on the server and handles the transaction. For example, if an intranet user sent a request with a Web browser for database information, a CGI program would execute on the server, retrieve the information from the database, format it in HTML, and send it back to the user. Abbreviated CGI.

(World-Wide Web)Common Gateway Interface - (CGI) A standard for running external programs from a World-Wide Web HTTP server. CGI specifies how to pass arguments to the program as part of the HTTP request. It also defines a set of environment variables that are made available to the program. The program generates output, typically HTML, which the web server processes and passes back to the browser. Alternatively, the program can request URL redirection. CGI allows the returned output to depend in any arbitrary way on the request.

The CGI program can, for example, access information in a database and format the results as HTML. The program can access any data that a normal application program can, however the facilities available to CGI programs are usually limited for security reasons.

Although CGI programs can be compiled programs, they are more often written in a (semi) interpreted language such as Perl, or as Unix shell scripts, hence the common name "CGI script".

Here is a trivial CGI script written in Perl. (It requires the "CGI" module available from CPAN).

#!/usr/bin/perl use CGI qw(:standard);

print header, start_html, h1("CGI Test"), "Your IP address is: ", remote_host(), end_html;

When run it produces an HTTP header and then a simple HTML page containing the IP address or hostname of the machine that generated the initial request. If run from a command prompt it outputs:

Content-Type: text/html; charset=ISO-8859-1

Untitled Document

CGI Test

Your IP address is: localhost

The CGI program might be saved as the file "test.pl" in the appropriate directory on a web server, e.g. "/home/httpd/test".

Accessing the appropriate URL, e.g. http://acme.com/test/test.pl, would cause the program to run and a custom page produced and returned.

Early web servers required all CGI programs to be installed in one directory called cgi-bin but it is better to keep them with the HTML files to which they relate unless they are truly global to the site. Similarly, it is neither necessary nor desirable for all CGI programs to have the extension ".cgi".

Each CGI request is handled by a new process. If the process fails to terminate for some reason, or if requests are received faster than the server can respond to them, the server may become swamped with processes. In order to improve performance, Netscape devised NSAPI and Microsoft developed the ISAPI standard which allow CGI-like tasks to run as part of the main server process, thus avoiding the overhead of creating a new process to handle each CGI invocation. Other solutions include mod_perl and FastCGI.

Latest version: CGI/1.1.

http://hoohoo.ncsa.uiuc.edu/cgi.


How to thank TFD for its existence? Tell a friend about us, add a link to this page, add the site to iGoogle, or visit webmaster's page for free fun content.
?Page tools
Printer friendly
Cite / link
Feedback
Mentioned in?  References in periodicals archive?   Encyclopedia browser?   Full browser?
No references found
 
To check if installation is okay, there are 2 execution interfaces, CLI Command Line Interface and CGI Common Gateway Interface However, if you installed PHP in the \php directory, you can 1st try to check there To check if installation is okay, there are 2 execution interfaces, CLI Command Line Interface and CGI Common Gateway Interface.
The Common Gateway Interface (CGI) is a standard for interfacing external applications with information servers, such as HTTP or Web servers.
1, common gateway interface (CGI) and Perl scripting, HTML page authoring, email services, public and private threaded discussion, document indexing and sharing and cross-platform file sharing, which allows a NetWinder file server to support clients running Windows NT, 95 and Apple's Macintosh OS.
 
 
 
Encyclopedia
?

Terms of Use | Privacy policy | Feedback | Copyright © 2012 Farlex, Inc.
Disclaimer
All content on this website, including dictionary, thesaurus, literature, geography, and other reference data is for informational purposes only. This information should not be considered complete, up to date, and is not intended to be used in place of a visit, consultation, or advice of a legal, medical, or any other professional.