system级别配置php-开机自启方式

配置服务

vi /etc/systemd/system/php-fpm.service

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

[Service]
Type=simple
PIDFile=/run/php-fpm.pid
ExecStart=/usr/local/php/sbin/php-fpm --nodaemonize --fpm-config /usr/local/php/etc/php-fpm.conf
ExecReload=/bin/kill -USR2 $MAINPID
ExecStop=/bin/kill -SIGINT $MAINPID

[Install]
WantedBy=multi-user.target

启动PHP服务

systemctl start php-fpm.service

设置开机启动php

systemctl enable php-fpm.service

posted @ 2021-04-16 12:48  浅笑若风  阅读(349)  评论(0编辑  收藏  举报