PHP 启动脚本
修改php-fpm.conf
/opt/php7.4.14//etc/php-fpm.conf
添加pid路径
; Pid file ; Note: the default prefix is /usr/local/php/var ; Default Value: none ;pid = /var/run/php-fpm.pid pid = /opt/php7.4.14/var/run/php-fpm.pid
路径:
vim /usr/lib/systemd/system/php-fpm.service
脚本:
[Unit] Description=The PHP FastCGI Process Manager After=syslog.target network.target [Service] Type=forking PIDFile=/opt/php7.4.14/var/run/php-fpm.pid ExecStart=/opt/php7.4.14/sbin/php-fpm --fpm-config /opt/php7.4.14/etc/php-fpm.conf ExecReload=/bin/kill -USR2 $MAINPID ExecStop=/bin/kill -SIGINT $MAINPID [Install] WantedBy=multi-user.target
重新加载配置文件
systemctl daemon-reload
停止运行中的php-fpm进程
查看当前进程列表是否存在 php-fpm 进程:
ps aux|grep php-fpm
如果存在 php-fpm 进程,需先终止该进程
kill -9 xxxx
使用systemctl管理php-fpm
启动服务
systemctl start php-fpm
查看状态
systemctl status php-fpm
停止服务
systemctl stop php-fpm
重启服务
systemctl restart php-fpm
修改配置文件后重载
systemctl reload php-fpm
开机自启动
systemctl enable php-fpm
禁止开机自启动
systemctl didable php-fpm

浙公网安备 33010602011771号