Home  >  Article  >  Backend Development  >  Does php-fpm depend on php-cgi?

Does php-fpm depend on php-cgi?

WBOY
WBOYOriginal
2016-12-05 13:44:191394browse

Environmental Description

  • CentOS7

  • php version: php 5.6

  • php development environment: nginx+php+mysql

I read this question, but I don’t know if it is correct. https://segmentfault.com/q/10...
Under CentOS7, when searching for php-related processes, I only see the php-fpm process and not the php-cgi process. I am very confused and begging for answers

<code class="shell">[vagrant@lnmptest dishes]$ sudo ps -ef | grep php
root     16954     1  0 14:08 ?        00:00:00 php-fpm: master process (/usr/local/php/etc/php-fpm.conf)
nobody   16955 16954  0 14:08 ?        00:00:00 php-fpm: pool www
nobody   16956 16954  0 14:08 ?        00:00:00 php-fpm: pool www
vagrant  18676  4907  0 15:46 pts/0    00:00:00 grep --color=auto php</code>

Does the php-fpm sub-process come with its own php interpreter, or does it need to call php-cgi to interpret php?

Reply content:

Environmental Description

  • CentOS7

  • php version: php 5.6

  • php development environment: nginx+php+mysql

I read this question, but I don’t know if it is correct. https://segmentfault.com/q/10...
Under CentOS7, when searching for php-related processes, I only see the php-fpm process and not the php-cgi process. I am very confused and begging for answers

<code class="shell">[vagrant@lnmptest dishes]$ sudo ps -ef | grep php
root     16954     1  0 14:08 ?        00:00:00 php-fpm: master process (/usr/local/php/etc/php-fpm.conf)
nobody   16955 16954  0 14:08 ?        00:00:00 php-fpm: pool www
nobody   16956 16954  0 14:08 ?        00:00:00 php-fpm: pool www
vagrant  18676  4907  0 15:46 pts/0    00:00:00 grep --color=auto php</code>

Does the php-fpm sub-process come with its own php interpreter, or does it need to call php-cgi to interpret php?

php-fpm and php-cgi are different and do not depend on each other

Understand cgi, php-cgi php-fpm
cgi is the standard for web server to transmit data, and has nothing to do with language
php-cgi is the cgi implementation of php, which is the interpreter of php
php-fpm manages php-cgi Process manager, similar to spawn-fcgi, because php-fpm is too good, so php-fpm has been integrated into the kernel since 5.3

Statement:
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