Php-fpmfastcgiphpcgi what are these used?

Source: Internet
Author: User
I often see these things, but I can't understand the information I found on the Internet. Concept understanding: CGI, FastCGI, PHP-CGI and PHP-FPM is best to give a chestnut! Thank you for reading these things frequently, but you cannot understand the information you have found on the Internet.

Concept: CGI, FastCGI, PHP-CGI and PHP-FPM

It is best to give a chestnut!

Thank you.

Reply content:

I often see these things, but I can't understand the information I found on the Internet.

Concept: CGI, FastCGI, PHP-CGI and PHP-FPM

It is best to give a chestnut!

Thank you.

CGI is an interface rule used to establish the communication mode between the HTTP server and the dynamic processing program.
FastCGI is an implementation of CGI. it allows a CGI process to process multiple requests by making the CGI processing program resident process, reduces the time and resource consumption for repeatedly starting CGI programs.

Php-cgi is a FastCGI used to provide PHP program processing.
Php-fpm (FastCGI Process Manager) is a management tool for managing FastCGI processes on the FastCGI program.
Php-cgi is a single process. when a php-cgi is enabled to process requests, only one request can be processed at a time, and other requests are queued.
Php-fpm manages multiple FastCGI processes so that requests can be concurrently sent to multiple FastCGI processes for simultaneous processing.
It can be simply understood that php-fpm manages multiple php-cgi

For example, a request is sent from the client to the Nginx server and then processed by the PHP program:

  • Requests are sent to the Nginx server. The Nginx server sends requests to the php-fpm according to the configuration. However, Nginx and php-fpm are the products of the two companies, if they make sure that they can read the information sent by the other party? This is because they follow the CGI rules during design.

  • After receiving the request, php-fpm finds an idle process in the FastCGI process managed by the user to process the request.

  • In addition, Nginx can also be connected to php-cgi, but php-cgi does not have a process management module, but is a single process.

According to Yin Chuan's answer, the relationship between FastCgi and 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.