A
A
Andrey Gorbatsevich2019-06-04 16:13:25
PHP
Andrey Gorbatsevich, 2019-06-04 16:13:25

nginx/php-fpm installation error, how to fix?

I work with Raspberry Pi Model 3B.
Installed php and nginx according to Grav's guide : https://getgrav.org/blog/raspberrypi-nginx-php7-dev
the old way (apt install nginx php-fpm) gave an error.
As it turned out, the problem is not in me, the problem is somewhere inside.
I put the team

[email protected] ~ sudo apt-get install -t buster php7.2 php7.2-curl php7.2-gd php7.2-fpm php7.2-cli php7.2-opcache php7.2-mbstring php7.2-xml php7.2-zip

Everything is downloaded, unpacked, but when setting it up, it throws an error:
Log

Creating config file /etc/php/7.2/fpm/php.ini with new version
Created symlink /etc/systemd/system/multi-user.target.wants/php7.2-fpm.service → /lib/systemd/system/php7.2-fpm.service.
Job for php7.2-fpm.service failed because the control process exited with error code.
See "systemctl status php7.2-fpm.service" and "journalctl -xe" for details.
invoke-rc.d: initscript php7.2-fpm, action "start" failed.
● php7.2-fpm.service - The PHP 7.2 FastCGI Process Manager
   Loaded: loaded (/lib/systemd/system/php7.2-fpm.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Tue 2019-06-04 20:00:52 +07; 36ms ago
     Docs: man:php-fpm7.2(8)
  Process: 8667 ExecStart=/usr/sbin/php-fpm7.2 --nodaemonize --fpm-config /etc/php/7.2/fpm/php-fpm.conf (code=exited, status=127)
 Main PID: 8667 (code=exited, status=127)

Jun 04 20:00:52 raspi systemd[1]: Starting The PHP 7.2 FastCGI Process Manager...
Jun 04 20:00:52 raspi php-fpm7.2[8667]: [122B blob data]
Jun 04 20:00:52 raspi systemd[1]: php7.2-fpm.service: Main process exited, code=exited, status=127/n/a
Jun 04 20:00:52 raspi systemd[1]: Failed to start The PHP 7.2 FastCGI Process Manager.
Jun 04 20:00:52 raspi systemd[1]: php7.2-fpm.service: Unit entered failed state.
Jun 04 20:00:52 raspi systemd[1]: php7.2-fpm.service: Failed with result 'exit-code'.
dpkg: error processing package php7.2-fpm (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of php7.2:
 php7.2 depends on libapache2-mod-php7.2 | php7.2-fpm | php7.2-cgi; however:
  Package libapache2-mod-php7.2 is not installed.
  Package php7.2-fpm is not configured yet.
  Package php7.2-cgi is not installed.

dpkg: error processing package php7.2 (--configure):
 dependency problems - leaving unconfigured
Processing triggers for systemd (232-25+deb9u11) ...
Processing triggers for man-db (2.7.6.1-2) ...
Errors were encountered while processing:
 php7.2-fpm
 php7.2
E: Sub-process /usr/bin/dpkg returned an error code (1)


systemctl status php7.2-fpm.service

✘ [email protected] ~ systemctl status php7.2-fpm.service
● php7.2-fpm.service - The PHP 7.2 FastCGI Process Manager
   Loaded: loaded (/lib/systemd/system/php7.2-fpm.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Tue 2019-06-04 20:00:52 +07; 3min 24s ago
     Docs: man:php-fpm7.2(8)
 Main PID: 8667 (code=exited, status=127)

Jun 04 20:00:52 raspi systemd[1]: Starting The PHP 7.2 FastCGI Process Manager...
Jun 04 20:00:52 raspi php-fpm7.2[8667]: [122B blob data]
Jun 04 20:00:52 raspi systemd[1]: php7.2-fpm.service: Main process exited, code=exited, status=127/n/a
Jun 04 20:00:52 raspi systemd[1]: Failed to start The PHP 7.2 FastCGI Process Manager.
Jun 04 20:00:52 raspi systemd[1]: php7.2-fpm.service: Unit entered failed state.
Jun 04 20:00:52 raspi systemd[1]: php7.2-fpm.service: Failed with result 'exit-code'.


`journalctl -xe` only lists sshd and kernel, nothing related to apt or php.
When executing php -v gives this:
✘ [email protected] ~ php -v
php: error while loading shared libraries: ☻7�: cannot open shared object file: No such file or directory

This sequence of characters is very surprising, because it is certainly important, but none of it is clear.
Installing nginx also gives nothing:
✘ [email protected] ~ sudo apt install nginx-full nginx

✘ [email protected] ~ sudo apt install nginx-full nginx
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 nginx-full : Depends: libnginx-mod-http-auth-pam (= 1.10.3-1+deb9u2) but 1.14.2-2 is to be installed
              Depends: libnginx-mod-http-dav-ext (= 1.10.3-1+deb9u2) but 1.14.2-2 is to be installed
              Depends: libnginx-mod-http-echo (= 1.10.3-1+deb9u2) but 1.14.2-2 is to be installed
              Depends: libnginx-mod-http-geoip (= 1.10.3-1+deb9u2) but 1.14.2-2 is to be installed
              Depends: libnginx-mod-http-image-filter (= 1.10.3-1+deb9u2) but 1.14.2-2 is to be installed
              Depends: libnginx-mod-http-subs-filter (= 1.10.3-1+deb9u2) but 1.14.2-2 is to be installed
              Depends: libnginx-mod-http-upstream-fair (= 1.10.3-1+deb9u2) but 1.14.2-2 is to be installed
              Depends: libnginx-mod-http-xslt-filter (= 1.10.3-1+deb9u2) but 1.14.2-2 is to be installed
              Depends: libnginx-mod-mail (= 1.10.3-1+deb9u2) but 1.14.2-2 is to be installed
              Depends: libnginx-mod-stream (= 1.10.3-1+deb9u2) but 1.14.2-2 is to be installed
              Depends: nginx-common (= 1.10.3-1+deb9u2) but 1.14.2-2 is to be installed
E: Unable to correct problems, you have held broken packages.


However, it becomes clear that we have held broken packages, but why broken is not clear.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
TyzhSysAdmin, 2019-06-04
@POS_troi

php7.2 depends on libapache2-mod-php7.2 | php7.2-fpm | php7.2-cgi; however:
  Package libapache2-mod-php7.2 is not installed.
  Package php7.2-fpm is not configured yet.
  Package php7.2-cgi is not installed.

add to install libapache2-mod-php7.2 and php7.2-cgi

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question