Php7-fpm 在 Centos7 中不是 运行

Php7-fpm isn't running in Centos7

我想在 CentOs 上启动 php7-fpm。

我使用以下命令启动 fpm:systemctl start php7-fpm.service

我没有报错,php7-fpm也没有运行ning('netstat -lntp`)

当我执行这个命令 systemctl status php7-fpm.service 时,我得到这个:

systemctl status php7-fpm.service
● php7-fpm.service - LSB: starts php7-fpm
   Loaded: loaded (/etc/rc.d/init.d/php7-fpm)
   Active: active (exited) since mar. 2016-07-12 17:12:43 CEST; 15h ago
     Docs: man:systemd-sysv-generator(8)
  Process: 818 ExecStart=/etc/rc.d/init.d/php7-fpm start (code=exited, status=0/SUCCESS)

juil. 12 17:12:42 centos7 systemd[1]: Starting LSB: starts php7-fpm...
juil. 12 17:12:42 centos7 php7-fpm[818]: /etc/rc.d/init.d/php7-fpm: ligne40: init_is_upstart : command not found
juil. 12 17:12:42 centos7 php7-fpm[818]: /etc/rc.d/init.d/php7-fpm: ligne119: log_daemon_msg : command not found
juil. 12 17:12:43 centos7 php7-fpm[818]: /etc/rc.d/init.d/php7-fpm: ligne68: start-stop-daemon : command not found
juil. 12 17:12:43 centos7 php7-fpm[818]: /etc/rc.d/init.d/php7-fpm: ligne125: log_end_msg : command not found
juil. 12 17:12:43 centos7 systemd[1]: Started LSB: starts php7-fpm.
juil. 12 17:24:51 centos7 systemd[1]: Started LSB: starts php7-fpm.

我怎样才能 运行 php7-fpm ?

问题是php7-fpm脚本中使用的函数没有定义。因此,您应该创建或更新许多文件。在您的 php7-fpm 文件中,包含用于使用某些数据或函数的文件。

  • /lib/lsb/init-functions(导入部分函数)
  • /lib/init/vars.sh(导入数据)

验证现有的初始化函数和 vars.sh 文件并尝试重新加载 php7-fpm。

此外,CentOS 上不存在 start-stop-daemon 命令。您应该手动安装:

wget http://blog.starcklin.com/files/dpkg_1.17.6.tar.xz
tar -xf dpkg_1.17.6.tar.xz
cd dpkg-1.17.6

sudo yum install ncurses-devel ncurses

./configure
make

cd utils
make

cc start-stop-daemon.c -o start-stop-daemon

sudo cp start-stop-daemon /usr/local/bin