PHP-FPM fastcgi phpcgi What are these for?

Source: Internet
Author: User
Tags nginx server
Often see these things, but the information on the Internet to see not understand, which can be popular to say.

Concept understanding: cgi,fastcgi,php-cgi and PHP-FPM

Better give me a chestnut!

Thank you

Reply content:

Often see these things, but the information on the Internet to see not understand, which can be popular to say.

Concept understanding: cgi,fastcgi,php-cgi and PHP-FPM

Better give me a chestnut!

Thank you

CGI is a set of interface rules that are used for the establishment of communication between HTTP servers and dynamic handlers.
FASTCGI is an implementation of CGI, which allows a CGI process to process multiple requests, reducing the time and resource consumption of repeatedly starting CGI programs by allowing the CGI handler to be resident.

PHP-CGI is a fastcgi to provide PHP program processing.
PHP-FPM (FastCGI process Manager) is a management tool that manages FastCGI processes on top of FastCGI programs.
PHP-CGI is a single process, when a php-cgi is opened to process a request, only one request can be processed at a time, and the remaining requests are queued.
PHP-FPM manages multiple fastcgi processes, allowing requests to be sent in parallel to multiple fastcgi processes at the same time.
It is easy to understand that PHP-FPM manages multiple php-cgi

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

    • The request is sent to the Nginx server, the Nginx server is configured to send it to PHP-FPM, but Nginx and PHP-FPM are the products of two companies, if they make sure that they can read each other's message content? This is because they follow the rules of CGI when they are designed.

    • PHP-FPM receives the request, it finds an idle process in the FASTCGI process that it manages to handle the request

    • In addition Nginx can also docking php-cgi, but php-cgi no process management module, and is a single process.

Referring to Yinguan'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.