What is CGI?

cgi - server side scriptingCommon Gateway Interface (or CGI as it’s more commonly known as) is an Internet technology that makes it possible for a user of a webbrowser to communicate with a server or webhost in such a way that the user can request the server to run a program or script. These type of program which runs on the web server are known as CGI programs or CGI-scripts.
A lot of the HTML pages you see, may contain forms that uses a CGI program to process the form’s data once it’s submitted through the webbrowser. Another very common way to provide dynamic feedback for Web users is to include scripts or programs that run on the user’s machine rather than the Web server taking some of the load of the server and provide even more features to the user. This could be programs or scripts like Java applets, ActiveX controls or Java scripts.

A CGI program may be written a number of programming languages or scripts, but the most popular types of CGi developent is through languages such as PERL or C++. CGi Sscripts are usually used to describe CGI programs written in Perl as Perl is normally a compiler language where the source code is placed directly on the server and the program can run without having to be compiled first.

One pretty big problem with CGI is that each time a new CGI script is executed, a new process is started on the server. For Web sites with a lot of traffic, this can put a lot of load on the server and slow it down a lot as not all APACHE configurations can handle this amount of new processes.