PHP CGI vs. FPM relationships

Source: Internet
Author: User
Now my service is running in Nginx + FPM mode.

What is the difference between PHP and FPM running with CGI?

PHP Novice to these two concepts do not know very well, ask you.

Reply content:

Now my service is running in Nginx + FPM mode.

What is the difference between PHP and FPM running with CGI?

PHP Novice to these two concepts do not know very well, ask you.

Better with FPM.

CGI is the most primitive way, nginx for each request, create a PHP interpreter process, after processing the request, the process is destroyed.
FastCGI is an upgraded version of CGI, Nginx creates one (or more) persistent processes, processing requests individually, eliminating the overhead of creating and destroying processes.

PHPFPM is the PHP fastcgi Manager, there are a lot of practical functions (such as the flexibility to configure the process pool management policy), should be said to be the best choice for nginx mates.

PHP-FPM is a patch written for the PHP kernel to handle the start, stop, and restart of FastCGI processes as needed .

  1. Low memory usage (because Nginx does not load the entire PHP environment when running alone).
  2. Easily manage user permissions (because PHP can manage different users in your server process).
  3. When PHP crashes, Nginx can run as usual.

Recently, it has been reported that PHP5.4 will most likely have PHP-FPM (PHP FastCGI process Manager) patches included in the kernel.

  • 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.