Three ways to execute PHP interpreter:
1. mod_php: module form in apache; a single process can handle multiple requests
2. Cgi:Common Gateway Interface, Protocol
php-cgi: 1) The implementation of the CGI protocol to interpret the PHP request; procedure: php request->php-cgi Read and parse
PHP.ini file, initializing environment, Returning processing results based on request parameters
2) a single process can only process one request, and each process needs to read php.ini for parsing, less efficient
3) after modifying the php.ini file, start the PHP-CGI program will not take effect, unable to smooth restart
650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "spacer.gif"/> 650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M00/8D/B4/wKioL1imw1PhbAqfAAE3JxLSiMw742.png "title=" 1.png "alt=" Wkiol1imw1phbaqfaae3jxlsimw742.png "/>
3. Fast-cgi: optimized for CGI protocol, improved performance
php-fpm:1) Implementation of FAST-CGI protocol to parse PHP request, process: php request->php-fpm read
PHP.ini initialization environment, Start a master-> to start multiple worker->master and pass the request
Hand work->php-fpm Dynamic configuration of worker number
2) A single process processes multiple requests by starting multiple php-cgi programs
3) Modify the php.ini file, start a new worker, invoke the new configuration, and implement a smooth restart
650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "spacer.gif"/>
650) this.width=650; "src=" https://s5.51cto.com/wyfs02/M00/8D/B6/wKiom1imw3LCwjsXAAJLc-yIyP0495.png "title=" 2.png "alt=" Wkiom1imw3lcwjsxaajlc-yiyp0495.png "/>
This article is from "a horse on the plains" blog, please be sure to keep this source http://huangzp.blog.51cto.com/12434999/1898910
CGI and php-cgi and fast-cgi and php-fpm understanding