3

When running

sudo apt-get update
sudo apt-get upgrade

I get in red the following error: Failed to start The PHP 7.0 FastCGI Process Manager.

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)

I noticed that I have /etc/php/7.0/ and /etc/php/7.1/ but that only the 7.1 has a fpm sub-folder in it. Somehow something must be cross-linked somewhere.

How can I fix this?

sotirov
  • 4,379
MeSo2
  • 451

2 Answers2

2

It looks like you only had the php7.0 package installed, but you did not had the php7.0-fpm package installed. On the other hand it looks like you had the php7.1-fpm package. So, depending on what you want to do, there are 2 ways to fix this:

Use php7.1 instead of php7.0

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

Install php7.0-fpm

sudo apt install php7.0-fpm
sudo service apache2 restart
sotirov
  • 4,379
2

This worked for me -- (I am running Ubuntu 17.04)

I did a fresh install after removing php. Over all this added a bunch of new folders. Now I have 5.6 7.0 7.1 and 7.2.

source: Migrating from PHP 7.0.x to PHP 7.1.x

For fresh installation on Ubuntu 16.04 (I am running 17.04) If we want to install new version && Remove all php dependencies sudo apt-get remove php*

sudo apt-get install 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

MeSo2
  • 451