2

On attempting to install php7.0-fpm

# apt-get install php7.0-fpm

I'm getting the following error (copied from /var/log/apt/term.log):

Preparing to unpack .../php7.0-fpm_7.0.8-0ubuntu0.16.04.2_amd64.deb ...
Unpacking php7.0-fpm (7.0.8-0ubuntu0.16.04.2) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up php7.0-fpm (7.0.8-0ubuntu0.16.04.2) ...

Creating config file /etc/php/7.0/fpm/php.ini with new version
invoke-rc.d: initscript php7.0-fpm, action "start" failed.
dpkg: error processing package php7.0-fpm (--configure):
 subprocess installed post-installation script returned error exit status 1
Processing triggers for ureadahead (0.100.0-19) ...
Errors were encountered while processing:
 php7.0-fpm

So a problem exists, but what is causing it?

As suggested here, I've tried the following, but no error is found:

root@ubuntu:/etc/apt# /usr/sbin/php-fpm7.0 --test
[08-Sep-2016 08:44:44] NOTICE: configuration file /etc/php/7.0/fpm/php-fpm.conf test is successful

I've also tried removing and reinstalling php7.0-fpm, as suggested here, but this made no difference.

Can you suggest how to fix this error? Are there some more helpful error messages somewhere?

UPDATE:

This is happening when installing php7.0 on a linux container. The error does not occur when installing on a Virtual Machine from the same hosting provider. So, perhaps the installation is attempting to set something that is "out of bounds" for the container.

My "workaround" is to use a VM instead of a container :-)

Matt Wallis
  • 201
  • 2
  • 10

2 Answers2

3

I've ran into a similar issue while using a Elastichosts Container Server (Arachsys container). The only way to get php7.0-fpm to 'talk' what is wrong, is to start it by hand in daemon mode:

/usr/sbin/php-fpm7.0 -D

This produced an error regarding a missing socket file:

ERROR: unable to bind listening socket for address '/run/php/php7.0-fpm.sock': No such file or directory (2)

As it turns out the directory /run/php never got created during install. Creating it by hand and giving it the correct owner (www-data) has solved the issue for me (after a reboot).

0

Create a directory for sock-file:

mkdir -p /var/run/
abu_bua
  • 10,473
  • 10
  • 45
  • 62
redflasher
  • 101
  • 1
  • 1
    Welcome to [ubuntu.se]! On my system, `/var/run` is a symlink to `/run`. Should it really be a standalone directory? – Melebius Oct 10 '18 at 06:37
  • Hi! Just look where php-fpm want create yourself sock-file and sure that directory is exists. – redflasher Oct 10 '18 at 08:22