Speaking of FastCGI, You Have To Say CGI.
CGI is the common gateway.
Interface, usually translated as a Common Gateway Interface, is an interface for the HTTP server to communicate with other programs on the machine. This "other program" can be written in any computer language,
It obtains input from the HTTP server through the CGI interface, and then delivers the running result to the HTTP server through the CGI interface, which then sends the result to the browser.
The emergence of CGI changes the web from static to dynamic. As the Web becomes increasingly popular, many websites need dynamic pages to interact with viewers. The disadvantage of CGI is becoming more and more prominent. Because
To generate a dynamic page for HTTP, the system must start a new process to run the CGI program. Continuously fork is a task that consumes a lot of time and resources. FastCGI appears.
Baidu encyclopedia about FastCGI
1. FastCGI is like a long-live CGI, which can be executed all the time. Once activated, it will not take time
Fork once (this is the most criticized fork-and-execute mode for CGI ).
2. FastCGI can be used on any platform. Both Netscape Enterprise and IIS have FastCGI.
Modules are available. Apache (and the servers derived from Apache) also has mod_fastcgi available.
3. FastCGI supports C/C ++, Ruby, Perl, TCL, Java, Python, and other programming languages.
4. FastCGI applications are also compatible with CGI. That is, the FastCGI application can also be executed as CGI.
5. It is very easy to rewrite the existing CGI program to FastCGI. At least three lines of program code must be added.
6. the FastCGI debugging method is similar to CGI. You only need to bring the environment variables and parameters required by the program into the command column mode to execute or detect errors.
7. The writing method of the FastCGI application is similar to that of CGI. In addition to the several principles, the writing method of FastCGI is similar to that of CGI.
Similar to learning web server APIs, FastCGI is much simpler.
8. FastCGI supports distributed computing (Distributed Computing), that is, FastCGI
The program can be executed on a host other than the website server and receive requests from other website servers.
Mod_php uses PHP as a built-in module of Apache. Make Apache
The HTTP server itself supports the PHP language and starts the PHP interpreter to explain PHP without every request.