PHP脚本调用systemctl,systemctl start php-fpm.service错误,systemctl enable php-fpm.service错误...

背景:源码安装了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

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值