What’s CGI?

Print anything with Printful



A gateway can connect networks or act as an intermediary between systems. The Common Gateway Interface (CGI) is a standard and interface that connects server-side resources to the web. CGI scripts process database queries, but newer methods like ASP and JSP are now used. FastCGI and SCGI are CGI extensions.

In the realm of computers, a gateway can be several things, including a node that physically connects disparate networks, translating their protocols so they can communicate, or a functional service that provides an intermediary between multiple systems. Gateway programs can act as a gateway between server-side resources, such as databases, and the Web. The Common Gateway Interface (CGI) was the initial mechanism that acted as a generic interface between the server and these server-side gateway programs and was used by the most servers to process client requests that required server-side data processing. It is a standard as well as an interface.

The common gateway interface works in two directions. Let’s say a user submits a request through a web browser, such as submitting an HTML form with data to be added to a mailing list. HTTP server can only serve documents, not process data. Then, after the HTTP (HyperText Transfer Protocol) of the data to the server is completed, the Common Gateway Interface transmits the data from the server to the gateway program which connects to the database. Processing results, such as a confirmation message, are returned to the user traveling the reverse path: from the database to the gateway program via the Common Gateway Interface to the server, via HTTP to the user’s web browser.

A Common Gateway Interface script is the name of the software program used to process a database query. It had the advantage of being OS independent, meaning it would run on a server regardless of which operating system it was running. While CGI was heavily used in the early days of the web, there are now newer, more efficient server-side methods of processing queries, and now these are found as well. These include ASP (Active Server Page) and its newer version ASP.NET (Active Server Page for dot-net, also known as ASP+) and JSP® (JavaServer Page), which allows the combination of HTML (HyperText Markup Language) and Java to work seamlessly on a single web page, but keep in mind that ASP is made by Microsoft® and only runs on Microsoft® web servers.

Even the CGI itself developed. FastCGI, an open-standard, language-independent CGI extension that enables distributed computing and, unlike CGI, does not exit after each request has completed, but persists, waiting for the next request. SCGI (Simple CGI) is another alternative, both a protocol and a program, released into the public domain by its creator.




Protect your devices with Threat Protection by NordVPN


Skip to content