1.php7.3.8默认安装
./configure --enable-fpm
2.配置
groupadd www useradd -g www www cp /usr/local/etc/php-pfm.conf.default /usr/local/etc/php-fpm.conf cp /usr/local/etc/php-pfm.d/www.conf.default /usr/local/etc/php-fpm.d/www.conf vim /usr/local/etc/php-fpm.conf //修改配置 pid = run/php-fpm.pid //user = www //group = www
3.启动
/usr/local/sbin/php-fpm //查看状态 ps -ef|grep php-fpm
4.开机启动
vim /etc/rc.local 加入 /usr/local/sbin/php-fpm
5.重启fpm
INT 立即终止
QUIT 平滑终止
USR1 重新打开日志文件
USR2 平滑重载所有worker进程并重新载入配置和二进制模块
关闭 kill -INT `cat /usr/local/var/run/php-fpm.pid` 重启 kill -USR2 `cat /usr/local/var/run/php-fpm.pid`
6.配置和优化
模式分3种,static,dynamic,ondemand
7.开启slowlog
vim /usr/local/etc/php-fpm.d/www.conf slowlog = log/$pool.log.slow request_slowlog_timeout = 5
本文为看恩吧原创文章,转载无需和我联系,但请注明来自knsay.com