Centos7 配置 systemctl-php-fpm 服務
增加 php-fpm
的 pid 設定檔
vim /usr/local/php/etc/php-fpm.conf
; Pid file
; Note: the default prefix is /usr/local/php/var
; Default Value: none
pid: /var/run/php-fpm.pid
新增 php-fpm
系統服務
touch /usr/lib/systemd/system/php-fpm.service
編輯 php-fpm
系統服務設定
vim /usr/lib/systemd/system/php-fpm.service
[Unit]
Description=The PHP FastCGI Process Manager
After=syslog.target network.target
[Service]
Type=forking
PIDFile=/var/run/php-fpm.pid
ExecStart=/usr/local/php/sbin/php-fpm
ExecReload=/bin/kill -USR2 $MAINPID
PrivateTmp=true
[Install]
WantedBy=multi-user.target
重啟系統管理配置服務
systemctl daemon-reload
啟動服務 php-fpm
systemctl start php-fpm