Centos7下php-fpm的启动服务脚本


新增配置文件,根据自己安装的php-fpm路径修改   vim /temp/php-fpm.service

[Unit]
Description=The PHP FastCGI Process Manager
After=syslog.target network.target

[Service]
Type=simple
PIDFILE=/var/run/php-fpm.pid
ExecStartPre=/usr/bin/rm -f $PIDFILE ExecStart=/usr/local/php/sbin/php-fpm --nodaemonize --fpm-config /usr/local/php/etc/php-fpm.conf ExecRestart=/bin/kill -USR2 $PIDFILE ExecStop=/bin/kill -SIGINT $PIDFILE [Install] WantedBy=multi-user.target

 

加入到系统服务

cp /temp/php-fpm.service /etc/systemd/system/php-fpm.service

增加开机启动

systemctl enable php-fpm.service

操作命令

启动
systemctl start php-fpm.service 
停止 
systemctl stop php-fpm.service 
重启 
systemctl restart php-fpm.service

删除开机启动

systemctl disable php-fpm.service


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM