CGI, php-cgi, FASTCGI, PHP-FPM

Source: Internet
Author: User
Tags fpm

What does CGI do?

CGI is designed to ensure that the data passed by the Web server is in a standard format and facilitates the writer of CGI programs. Web server, such as Nginx, is simply the publisher of the content. For example, if the request is/index/html, then Web server will go to the file system to find this file, sent to the browser, here is distributed static data. If, the request is/index.php, According to the configuration file, Nginx know that this is not a static file, need to find a PHP parser to handle, then he will throw this request to the PHP interpreter, but how does he communicate with the PHP interpreter? CGI is a protocol that specifies the communication between them. when the PHP parser finishes processing the request and returns the processed result in the specified Cgui format, the process exits. The Web server then returns the results to the browser.

What is php-cgi?

php-cgi is the fastcgi manager that comes with PHP. has been deprecated because the modification of php.ini must be restarted to take effect and does not support a smooth restart; another reason is that PHP cannot run after the php-cgi process has been killed. (PHP-FPM and spawn-fcgi do not have this problem, the daemon will smooth the new child process from the newly generated.) )

What is fastcgi?

fastcgi is used to improve the performance of CGI programs. So what is the performance problem with CGI programs? "The PHP parser parses the php.ini file, initializes the execution environment," and here it is. Standard CGI performs these steps for each request, so it takes longer to process each time. This is obviously unreasonable! So how did fastcgi do it? The main behavior is to keep the CGI interpreter process in memory and therefore achieve high performance.

What is PHP-FPM?

PHP-FPM is a PHP fastcgi manager that can only be used in PHP.

CGI, php-cgi, FASTCGI, PHP-FPM

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.