Common Gateway Interface

From Just Solve the File Format Problem
(Difference between revisions)
Jump to: navigation, search
(Created page with "{{FormatInfo |formattype=electronic |subcat=Web |extensions={{ext|cgi}}, others }} '''Common Gateway Interface''' ('''CGI''') is a protocol by which a web server uses a lo...")
 
 
Line 2: Line 2:
 
|formattype=electronic
 
|formattype=electronic
 
|subcat=Web
 
|subcat=Web
|extensions={{ext|cgi}}, others
+
|extensions={{ext|cgi}}, {{ext|fcgi}}, others
 
}}
 
}}
 
'''Common Gateway Interface''' ('''CGI''') is a protocol by which a [[web]] server uses a local executable program to handle a request from a web browser.
 
'''Common Gateway Interface''' ('''CGI''') is a protocol by which a [[web]] server uses a local executable program to handle a request from a web browser.
  
CGI uses a convenient, but somewhat crude, kind of inter-process communication. For each suitable request it receives, the web server runs a new instance of the CGI handler program. It pipes the body of the request, if any, to the program's ''standard input'' stream. All other parameters are communicated via ''environment variables''.
+
CGI uses a convenient, if somewhat crude, kind of inter-process communication. For each suitable request it receives, the web server runs a new instance of the CGI handler program. It pipes the body of the request, if any, to the program's ''standard input'' stream. All other parameters are communicated via ''environment variables''.
  
 
The CGI handler writes its response to its ''standard output'' stream, which is read by the web server, and relayed over the network to the web browser.
 
The CGI handler writes its response to its ''standard output'' stream, which is read by the web server, and relayed over the network to the web browser.
  
A file with a '''.cgi''' extension might be a CGI handler program (though there are no restrictions on the name of a CGI handler program, other than those imposed by the operating system). If so, it will use a standard [[Executables|executable]] file format, not some hypothetical "CGI file format". A '''.cgi''' file could also be the saved response from a CGI handler, in which case the most likely format is [[HTML]] (though there are no restrictions on the file format of a CGI response).
+
A file with a '''.cgi''' extension might be a CGI handler program (though there are no restrictions on the name of a CGI handler program, other than those imposed by the operating system). If so, it will use a standard [[Executables|executable]] or scripting file format (such as [[Perl]]), not some hypothetical "CGI file format". A '''.cgi''' file could also be the saved response from a CGI handler, in which case the most likely format is [[HTML]] (though there are no restrictions on the file format of a CGI response).
  
 
== FastCGI ==
 
== FastCGI ==

Latest revision as of 20:24, 12 March 2017

File Format
Name Common Gateway Interface
Ontology
Extension(s) .cgi, .fcgi, others

Common Gateway Interface (CGI) is a protocol by which a web server uses a local executable program to handle a request from a web browser.

CGI uses a convenient, if somewhat crude, kind of inter-process communication. For each suitable request it receives, the web server runs a new instance of the CGI handler program. It pipes the body of the request, if any, to the program's standard input stream. All other parameters are communicated via environment variables.

The CGI handler writes its response to its standard output stream, which is read by the web server, and relayed over the network to the web browser.

A file with a .cgi extension might be a CGI handler program (though there are no restrictions on the name of a CGI handler program, other than those imposed by the operating system). If so, it will use a standard executable or scripting file format (such as Perl), not some hypothetical "CGI file format". A .cgi file could also be the saved response from a CGI handler, in which case the most likely format is HTML (though there are no restrictions on the file format of a CGI response).

[edit] FastCGI

A variant named FastCGI allows a single process to handle multiple requests. Some other method of inter-process communication is used, such as a Unix domain socket.

[edit] Links

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox