Quote:
|
Is CGI even a programming language at all? I thought it was just a standard communications protocol that languages use to interface with the server
|
Exactly, CGI means Common Gateway Interface (or computer generated images, but I bet it's not that one you talk about...).
It's just a way of exchanging datas between 2 programs.
As Abel wrote, PHP can use CGI to interact with the web server.
It's even pretty common. I have used a PHP4 with CGI for a while, when PHP5 was new, to have the .php4 files running with php4, and .php running with php5.
Most of what exists today as a CGI script is perl, right. But it could be anything...
Python, basic, lisp, fortran, even a simple application.... Basically anything that receive parameter and return something can be used as a CGI gateway.
If I remember right, I have seen web site that provided ping tools that simply used the ping linux utility.
It was a cgi that was calling to the executable, which returned the program output directly.
A side effect that have CGI, is that for every request the server receive, it will launch a new process of the interpreter.
If you use PHP with cgi, it means that each page request will trigger the launch of the PHP executable, to generate the page, and the web server will pass back the generated content to the browser.
On contrario, with a apache module compiled PHP, the interpreter is runing alongside the web server process, all the time, and can process the requests without the hassle of launching/stopping the interpreter at each requests.
(except when using something like
fastCgi, which launch 1 interpreter and then multiplex it to treat several requests, but it's not the most common setup)
Let me just add that I find pretty unfair that you have to write that paper just for a legitim question...
It looks more to me that your teacher learned to use CGI back in 1995, and did not much improved his skills since.