Home Backend Development PHP Problem The difference between phpcgi and phpfpm

The difference between phpcgi and phpfpm

Oct 11, 2019 pm 03:57 PM

The difference between phpcgi and phpfpm

What is PHP-CGI:

PHP-CGI is the FastCGI manager that comes with PHP. (Recommended learning: PHP video tutorial)

Start PHP-CGI and use the following command:

php-cgi -b 127.0.0.1:9000
Copy after login

Disadvantages of PHP-CGI:

1. After php-cgi changes the php.ini configuration, you need to restart php-cgi to make the new php-ini take effect. It cannot be restarted smoothly.

2. Directly kill the php-cgi process, php It won't work. (PHP-FPM and Spawn-FCGI do not have this problem. The daemon process will smoothly regenerate new child processes.)

What is PHP-FPM

PHP- FPM is a PHP FastCGI manager, which is only used for PHP. It can be downloaded at http://php-fpm.org/download.

PHP-FPM is actually a patch of the PHP source code. Integrating FastCGI process management into PHP packages. It must be patched into your PHP source code and can be used after compiling and installing PHP.

Now we can download the branch that directly integrates PHP-FPM in the latest PHP 5.3.2 source tree. It is said that the next version will be integrated into the main branch of PHP.

Compared with Spawn-FCGI, PHP-FPM has better CPU and memory control, and the former is easy to crash and must be monitored with crontab, while PHP-FPM does not have such troubles.

PHP5.3.3 has integrated php-fpm and is no longer a third-party package. PHP-FPM provides a better PHP process management method, which can effectively control memory and processes, and can smoothly reload PHP configuration. It has more advantages than spawn-fcgi, so it is officially included in PHP. You can enable PHP-FPM by passing the –enable-fpm parameter in ./configure.

The difference between the two:

php-cgi is the called process, and php-fpm is the configuration and management process.

The above is the detailed content of The difference between phpcgi and phpfpm. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1655
14
PHP Tutorial
1252
29
C# Tutorial
1226
24