nginx整合php-fpm:
编辑php-fpm.conf配置文件
;最后一行改成如下 include=/usr/local/etc/php-fpm.d/*.conf
进入/etc/php-fpm.d/目录下,修改www.conf
将user和group改成和nginx.conf中的user和group一致
nginx.conf在 /etc/nginx/目录下
user = nginx
group = www
重启nginx服务:
[root@instance-ozyu8y37 nginx]# ps aux|grep nginx
root 19342 0.0 0.2 121472 5340 ? Ss Nov29 0:00 nginx: master process /usr/sbin/nginx
nginx 92824 0.0 0.2 124012 4712 ? S 08:54 0:00 nginx: worker process
nginx 93326 0.0 0.2 323920 5104 ? S 09:04 0:00 php-fpm: pool www
nginx 93327 0.0 0.3 328192 6656 ? S 09:04 0:00 php-fpm: pool www
nginx 93328 0.0 0.3 328192 6652 ? S 09:04 0:00 php-fpm: pool www
nginx 93329 0.0 0.2 323920 5104 ? S 09:04 0:00 php-fpm: pool www
nginx 93330 0.0 0.2 323920 5108 ? S 09:04 0:00 php-fpm: pool www
root 94081 0.0 0.0 112704 972 pts/0 R+ 09:17 0:00 grep --color=auto nginx
[root@instance-ozyu8y37 nginx]# kill -USR2 19342
重启PHP服务:
[root@instance-ozyu8y37 nginx]# ps aux|grep php-fpm
root 17600 0.0 0.5 321836 11012 ? Ss Nov29 2:42 php-fpm: master process (/etc/php-fpm.conf)
nginx 93326 0.0 0.2 323920 5104 ? S 09:04 0:00 php-fpm: pool www
nginx 93327 0.0 0.3 328192 6656 ? S 09:04 0:00 php-fpm: pool www
nginx 93328 0.0 0.3 328192 6652 ? S 09:04 0:00 php-fpm: pool www
nginx 93329 0.0 0.2 323920 5104 ? S 09:04 0:00 php-fpm: pool www
nginx 93330 0.0 0.2 323920 5108 ? S 09:04 0:00 php-fpm: pool www
root 94145 0.0 0.0 112708 972 pts/0 S+ 09:18 0:00 grep --color=auto php-fpm
[root@instance-ozyu8y37 nginx]# kill -USR2 17600