3 kinds of PHP-CGI php cgi has 3 forms:
The most powerful FPM, the most powerful function, as long as the configuration of php-fpm.conf can be;
Fpm homepage: http://php-fpm.org/use spawn-fcgi, start command: env? PHP_FCGI_CHILDREN = 3 PHP_FCGI_MAX_REQUESTS = 1000 spawn-fcgi-a 127.0.0.1-p 9000-u www-data-g www-data-f php-cgi-P/var/run/spawn-fcgi.pid
In use, replace www-data with your username and group name;
The parameter description is as follows:
-F Specifies the location of the execution program of the process that calls FastCGI. it is set according to the PHP installed on the system.
-A is bound to the addr address.
-P Bind to port
-S Path bound to the unix socket
-C Number of FastCGI processes generated. the default value is 5 (for PHP only)
-P PID file path of the generated process
-U and-g FastCGI use the identity (-u user-g user group) to run. www-data can be used in Ubuntu, and other configuration based on the situation, such as nobody and apache.
Then we can add this line of code to the bottom of the/etc/rc. local file, so that the system can start the FastCGI process of PHP at the same time.
Start php-cgi directly and run the following command: php-cgi-B 127.0.0.1: 9000.
However, php-cgi uses the current user identity to execute session and other related operations. if a web user (such as www-data under ubuntu) can log on, run the following command: su www-data-l-c "php-cgi-B 127.0.0.1: 9000 ″
If www-data cannot be logged on (bash bit/bin/false), modify the user permission directly,
Sudo chown www-data: www-data which php-cgi
Sudo chmod u + s which php-cgi
BTW: check the ZF manual for a short period of time. There is a sentence at the beginning: for files that only contain PHP code, the end mark ("?> ") Is not allowed to exist, PHP itself does not need ("?> "), In this way, it can prevent the end of it from being accidentally injected. Faint ~~ This is what I know now.
Http://mifunny.info/run-php-as-cgi-339.html