CentOS 7设置php开机自启动

1.在系统服务目录里创建php-fpm.service文件

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

写入以下内容(路径改成自己的)

[Unit]
Description=php-fpm
After=network.target
[Service]
Type=forking
ExecStart=/usr/local/php-7.1.7/sbin/php-fpm
PrivateTmp=true
[Install]
WantedBy=multi-user.target

2.加入开机自启(重启后生效)

systemctl enable php-fpm.service #注意后面不能跟空格

3.查看运行的服务

systemctl list-units --type=service           #查看运行的服务
© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容