Skip to content
Search

Common Gateway Interface

lastmod 2023-04-11created 2014-03-112 edits

The Common Gateway Interface (CGI) is a mechanism for running user programs on a web server. Many existing web server programs can use CGI features.

The main function of a web server program is to send pre-prepared information in response to requests from users (clients). Because of this, server programs alone could not provide a mechanism that generates information dynamically on the spot and sends it to the client. A method was devised in which the server program calls another program and sends its processing result to the client. CGI is what defines how the server program and the external program work together to make this possible.

CGI can be extended and used from any programming language that can handle environment variables and standard input/output, but Perl was often used because of its balance of execution speed and ease of text processing. Recently[when?], not only Perl but also Python, Ruby, and others are widely used.

Typical applications include bulletin boards, hit counters, and wiki or blog systems.

Recently(?), Java Servlet, mod perl, mod php, FastCGI, and others have also been released; they improve performance by keeping an interpreter resident as a web server process, reducing the load of calling programs through CGI.

See also

Favorite site

author Zer0 sitemap