Welcome to my website, have a nice day!
Dream it, Do it, Make it!

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           #查看运行的服务
赞(0)
未经允许禁止转载:Ddmit » CentOS 7设置php开机自启动

评论 抢沙发

登录

找回密码

注册