解决windows下php-cgi.exe自动关闭
在windows下通过nginx,php-cgi.exe运行一段时间后 ,php-cgi.exe会退出户。由于单个php-cgi进程处理一定数量的请求后会自动关闭,所以可以使用xxfpm来管理php-cgi。
xxfpm下载地址:https://github.com/78/xxfpm
把下载的xxfpm-master.zip解压,复制里面bin目录的文件到C:/soft/xxfpm目录
修改php-cgi启动bat脚本
@ECHO OFF ECHO Starting PHP FastCGI... set PATH=C:\soft\php;%PATH% C:\soft\xxfpm\xxfpm.exe C:\soft\php\php-cgi.exe -n 2 -i 127.0.0.1 -p 9123
xxfpmd的启动参数如下,示例bat脚本你启动了2个线程,绑定ip为127.0.0.1,端口号为9123:
Usage: xxfpm path [-n number] [-i ip] [-p port] Manage FastCGI processes. -n, –number number of processes to keep -i, –ip ip address to bind -p, –port port to bind, default is 8000 -u, –user start processes using specified linux user -g, –group start processes using specified linux group -r, –root change root direcotry for the processes -h, –help output usage information and exit -v, –version output version information and exit