1. What is CGI?
is the public gateway interface protocol, a protocol. CGI is the protocol that stipulates what data is to be transmitted and in what format it is passed to the backend for processing the request.
2. What is FastCGI?
FastCGI is like a long-live CGI. It’s the same thing as CGI, but it’s optimized and it’s also a protocol
3. What is php-CGI?
PHP-CGI is the FastCGI process manager that comes with PHP.
4. What is php-fpm?
The third-party FastCG I process manager solves some problems of PHP-CGI and manages PHP-CGI.
5. What is the relationship between php-fpm and fastcgi?
php-fpm is for php, implements the FastCGI protocol, and provides a process manager for php-CGI management.
6. What problems does php-fpm solve?
Graceful restart of php-CGI.
php-Resident management of CGI. (Resident here means that php will hang up after the php-CGI process is killed, and php-fpm will restart php-CGI after the php process is killed)
Is dynamic and static separation implemented?
7. php-fpm runs independently on non-web servers to achieve the so-called dynamic and static separation.
8. php-cgi and php-fpm on php are both php’s implementation of the FastCGI protocol. The latter also provides management of php-CGI processes.
9. Since FastCGI is multi-process, it consumes more server memory than CGI multi-threading. That is to say, if your memory is not large and concurrent requests are not high, CGI is more suitable for you than FastCGI.
10. Web Server generally refers to servers such as Apache, Nginx, IIS, Lighttpd, and Tomcat.
11. Web Application generally refers to applications such as PHP, Java, and Asp.net.
12. What is SAPI? SAPI (Server Application Programming Interface) is an application programming interface. The most important SAPI in PHP is PHP-FPM. PHP-FPM is an implementation of FastCGI.
13. In layman’s terms, SAPI is php-CGI, php-cli, mod_php, etc., and php is the php kernel. The core of SAPI is a structure sapi_module_struct. php-CGI, php-cli, and mod_php all implement this structure.
14. PHP provides many kinds of SAPI by default, including php5_module, CGI, FastCGI for apache and nginx, ISAPI for IIS, and Shell CLI.
15. Agreement: a collection of rules. Interface: The constraints of the protocol in the code.
Recommended tutorial: "PHP Tutorial"
The above is the detailed content of CGI, FastCGI, PHP-CGI, PHP-FPM simple understanding. For more information, please follow other related articles on the PHP Chinese website!