php7.0-fpm.service:主进程退出 /etc/php/7.0/ 或 /etc/php/7.1/

php7.0-fpm.service:主进程退出 /etc/php/7.0/ 或 /etc/php/7.1/

跑步时

sudo apt-get update
sudo apt-get upgrade

我收到以下红色错误: 无法启动 PHP 7.0 FastCGI 进程管理器。

NOTICE: Not enabling PHP 7.0 FPM by default.
NOTICE: To enable PHP 7.0 FPM in Apache2 do:
NOTICE: a2enmod proxy_fcgi setenvif
NOTICE: a2enconf php7.0-fpm
NOTICE: You are seeing this message because you have apache2 package installed.
Job for php7.0-fpm.service failed because the control process exited with error code.
See "systemctl status php7.0-fpm.service" and "journalctl -xe" for details.
invoke-rc.d: initscript php7.0-fpm, action "restart" failed.
● php7.0-fpm.service - The PHP 7.0 FastCGI Process Manager
   Loaded: loaded (/lib/systemd/system/php7.0-fpm.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Sat 2017-10-07 12:01:40 PDT; 7ms ago
     Docs: man:php-fpm7.0(8)
  Process: 15565 ExecStart=/usr/sbin/php-fpm7.0 --nodaemonize --fpm-config /etc/php/7.0/fpm/php-fpm.conf (code=exited, status=78)
 Main PID: 15565 (code=exited, status=78)

Oct 07 12:01:40 cubi systemd[1]: Starting The PHP 7.0 FastCGI Process Manager...
Oct 07 12:01:40 cubi php-fpm7.0[15565]: [07-Oct-2017 12:01:40] ERROR: failed to open configuration file '/etc/php/7.0/fpm/php-fpm.conf': No such …rectory (2)
Oct 07 12:01:40 cubi php-fpm7.0[15565]: [07-Oct-2017 12:01:40] ERROR: failed to load configuration file '/etc/php/7.0/fpm/php-fpm.conf'
Oct 07 12:01:40 cubi php-fpm7.0[15565]: [07-Oct-2017 12:01:40] ERROR: FPM initialization failed
Oct 07 12:01:40 cubi systemd[1]: php7.0-fpm.service: Main process exited, code=exited, status=78/n/a
Oct 07 12:01:40 cubi systemd[1]: Failed to start The PHP 7.0 FastCGI Process Manager.
Oct 07 12:01:40 cubi systemd[1]: php7.0-fpm.service: Unit entered failed state.
Oct 07 12:01:40 cubi systemd[1]: php7.0-fpm.service: Failed with result 'exit-code'.
Hint: Some lines were ellipsized, use -l to show in full.
dpkg: error processing package php7.0-fpm (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 php7.0-fpm
E: Sub-process /usr/bin/dpkg returned an error code (1)

我注意到我有/etc/php/7.0/和,/etc/php/7.1/但只有其中7.1有一个fpm子文件夹。 某处肯定有交叉链接。

我怎样才能解决这个问题?

答案1

看起来您只安装了php7.0软件包,但实际上您没有php7.0-fpm安装软件包。另一方面,看起来您安装了软件包php7.1-fpm。因此,根据您要执行的操作,有两种方法可以解决此问题:

使用 php7.1 而不是 php7.0

sudo a2disconf php7.0-fpm
sudo a2enconf php7.1-fpm
sudo service apache2 restart

安装php7.0-fpm

sudo apt install php7.0-fpm
sudo service apache2 restart

答案2

这对我有用——(我正在运行 Ubuntu 17.04)

删除 php 后,我进行了全新安装。总之,添加了许多新文件夹。现在我有 5.6 7.0 7.1 和 7.2。

来源:从 PHP 7.0.x 迁移到 PHP 7.1.x

在 Ubuntu 16.04 上全新安装(我运行的是 17.04)如果我们要安装新版本 && 删除所有 php 依赖项 sudo apt-get remove php*

安装 php7.1 php7.1-cli php7.1-common libapache2-mod-php7.1 php7.1-mysql php7.1-fpm php7.1-curl php7.1-gd php7.1-bz2 php7.1-mcrypt php7.1-json php7.1-tidy php7.1-mbstring php-redis php-memcached

相关内容