首页 新闻 会员 周边

systemctl start php-fpm.service错误,systemctl enable php-fpm.service错误

0
悬赏园豆:100 [已解决问题] 解决于 2019-02-20 10:12

背景:源码安装了php7,进入sbin目录“./php-fpm”启动php正常,但如下添加自启动等操作则失败,求解啊

1.安装完后添加启动配置文件php-fpm.service,并编辑vi /usr/lib/systemd/system/php-fpm.service,内容输入
[Unit]Description=The PHP FastCGI Process Manager
After=network.target


[Service]Type=simple
PIDFile=/lnmp/soft/php/var/run/php-fpm.pid 
ExecStart=/lnmp/soft/php/sbin/php-fpm --nodaemonize --fpm-config /lnmp/soft/php/etc/php-fpm.conf
ExecReload=/bin/kill -USR2 $MAINPID
PrivateTmp=true


[Install]WantedBy=multi-user.target

2.使用systemctl start php-fpm启动,提示
Failed to start php-fpm.service: Unit is not loaded properly: Bad message.See system logs and 'systemctl status php-fpm.service' for details.
执行命令systemctl status php-fpm.service,显示多条如下错误信息
** [/usr/lib/systemd/system/php-fpm.service:1] Invalid section header '[Unit]Description=The PHP FastCGI Process Manager'**
3.使用systemctl enable php-fpm.service,提示Failed to execute operation: Bad message

陈*标的主页 陈*标 | 初学一级 | 园豆:102
提问于:2019-02-20 09:52
< >
分享
最佳答案
0

[Unit], [Service], [Install] 需要单独放一行

收获园豆:100
dudu | 高人七级 |园豆:31007 | 2019-02-20 10:05

谢了哈,这就结贴

陈*标 | 园豆:102 (初学一级) | 2019-02-20 10:12
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册