打开:
vim /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
添加到开机启动:
systemctl enable php-fpm.service
下面就可以使用systemctl
命令管理php-fpm
了:
# 启动php-fpm:
systemctl start php-fpm.service
# 重启php-fpm:
systemctl reload php-fpm.service
# 停止php-fpm:
systemctl stop php-fpm.service
打开文件:
vim /etc/profile
末尾添加:
PATH=$PATH:/usr/local/php/bin:/usr/local/php/sbin:
export PATH
使配置生效:
source /etc/profile
暂无评论,赶紧发表一下你的看法吧。