1

Как я могу выяснить, что мешает мне запустить php7.0-fpm . Кажется, ничто не показывает, что мешает ему начать.

$ sudo service php7.0-fpm status
● 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 Fri 2017-08-11 16:52:04 EDT; 20h ago
 Main PID: 4171 (code=exited, status=78)

Aug 11 16:52:04 foo.com systemd[1]: Starting The PHP 7.0 FastCGI Process Manager...
Aug 11 16:52:04 foo.com php-fpm7.0[4171]: [11-Aug-2017 16:52:04] ERROR: An another FPM instance seems to already listen on /run/php/php7.0-fpm.sock
Aug 11 16:52:04 foo.com php-fpm7.0[4171]: [11-Aug-2017 16:52:04] ERROR: FPM initialization failed
Aug 11 16:52:04 foo.com systemd[1]: php7.0-fpm.service: Main process exited, code=exited, status=78/n/a
Aug 11 16:52:04 foo.com systemd[1]: Failed to start The PHP 7.0 FastCGI Process Manager.
Aug 11 16:52:04 foo.com systemd[1]: php7.0-fpm.service: Unit entered failed state.
Aug 11 16:52:04 foo.com systemd[1]: php7.0-fpm.service: Failed with result 'exit-code'.

Попытка определить, связан ли какой-либо процесс с сокетом, не дает результатов.

$ ps aux | grep fpm
me  19222  0.0  0.0  12944   984 pts/0    S+   13:56   0:00 grep --color=auto fpm

$ ps aux | grep php
me  19230  0.0  0.0  12944   976 pts/0    S+   13:56   0:00 grep --color=auto php

Я не могу запустить службу

$ sudo service php7.0-fpm start
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.

подробности журнала

$ journalctl -xe -n 20
Aug 12 14:26:48 foo.com sudo[27777]:  me : TTY=pts/0 ; PWD=/etc/apache2/sites-available ; USER=root ; COMMAND=/usr/sbin/service php7.0-fpm start
Aug 12 14:26:48 foo.com sudo[27777]: pam_unix(sudo:session): session opened for user root by me(uid=0)
Aug 12 14:26:48 foo.com systemd[1]: Starting The PHP 7.0 FastCGI Process Manager...
-- Subject: Unit php7.0-fpm.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit php7.0-fpm.service has begun starting up.
Aug 12 14:26:48 foo.com php-fpm7.0[27818]: [12-Aug-2017 14:26:48] ERROR: An another FPM instance seems to already listen on /run/php/php7.0-fpm.sock
Aug 12 14:26:48 foo.com php-fpm7.0[27818]: [12-Aug-2017 14:26:48] ERROR: FPM initialization failed
Aug 12 14:26:48 foo.com systemd[1]: php7.0-fpm.service: Main process exited, code=exited, status=78/n/a
Aug 12 14:26:48 foo.com sudo[27777]: pam_unix(sudo:session): session closed for user root
Aug 12 14:26:48 foo.com systemd[1]: Failed to start The PHP 7.0 FastCGI Process Manager.
-- Subject: Unit php7.0-fpm.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit php7.0-fpm.service has failed.
--
-- The result is failed.
Aug 12 14:26:48 foo.com systemd[1]: php7.0-fpm.service: Unit entered failed state.
Aug 12 14:26:48 foo.com systemd[1]: php7.0-fpm.service: Failed with result 'exit-code'.

результаты статуса systemctl

$ systemctl status php7.0-fpm.service
● 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-08-12 14:29:46 EDT; 4s ago
  Process: 28363 ExecStart=/usr/sbin/php-fpm7.0 --nodaemonize --fpm-config /etc/php/7.0/fpm/php-fpm.conf (code=exited, status=78)
  Process: 28354 ExecStartPre=/usr/lib/php/php7.0-fpm-checkconf (code=exited, status=0/SUCCESS)
 Main PID: 28363 (code=exited, status=78)

Aug 12 14:29:46 foo.com systemd[1]: Starting The PHP 7.0 FastCGI Process Manager...
Aug 12 14:29:46 foo.com php-fpm7.0[28363]: [12-Aug-2017 14:29:46] ERROR: An another FPM instance seems to already listen on /run/php/php7.0-fpm.sock
Aug 12 14:29:46 foo.com php-fpm7.0[28363]: [12-Aug-2017 14:29:46] ERROR: FPM initialization failed
Aug 12 14:29:46 foo.com systemd[1]: php7.0-fpm.service: Main process exited, code=exited, status=78/n/a
Aug 12 14:29:46 foo.com systemd[1]: Failed to start The PHP 7.0 FastCGI Process Manager.
Aug 12 14:29:46 foo.com systemd[1]: php7.0-fpm.service: Unit entered failed state.
Aug 12 14:29:46 foo.com systemd[1]: php7.0-fpm.service: Failed with result 'exit-code'.

команды отладки

$ sudo /usr/sbin/php-fpm7.0 --nodaemonize --fpm-config /etc/php/7.0/fpm/php-fpm.conf
[12-Aug-2017 15:00:23] ERROR: An another FPM instance seems to already listen on /run/php/php7.0-fpm.sock
[12-Aug-2017 15:00:23] ERROR: FPM initialization failed

1 ответ1

0

Мне просто нужно было удалить файл sock, и тогда php-fpm снова запустится.

$ rm /run/php/php7.0-fpm.sock

или на моей конфигурации это было:

$ rm /var/run/php/php7.0-fpm.sock

Всё ещё ищете ответ? Посмотрите другие вопросы с метками .