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