Ubuntu Server 14.04升级18.04导致PHP7.2-fpm服务超时

Ubuntu Server 14.04升级18.04导致PHP7.2-fpm服务超时

我有一个 DigitalOcean droplet,在 dist-upgrade 之后遇到了各种问题。最近我尝试重新安装,php7.2fpm并得到了以下输出:

invoke-rc.d: initscript php7.2-fpm, action "restart" 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: timeout) since Wed 2023-11-01 15:55:34 EDT; 6ms ago
     Docs: man:php-fpm7.2(8)
  Process: 2717 ExecStart=/usr/sbin/php-fpm7.2 --nodaemonize --fpm-config /etc/php/7.2/fpm/php-fpm.conf (code=killed, signal=TERM)
 Main PID: 2717 (code=killed, signal=TERM)

Nov 01 15:54:04 meepmurp systemd[1]: Starting The PHP 7.2 FastCGI Process Manager...
Nov 01 15:55:34 meepmurp systemd[1]: php7.2-fpm.service: Start operation timed out. Terminating.
Nov 01 15:55:34 meepmurp systemd[1]: php7.2-fpm.service: Failed with result 'timeout'.
Nov 01 15:55:34 meepmurp systemd[1]: Failed to start The PHP 7.2 FastCGI Process Manager.

实际上,在几次重新安装之前,该服务可以启动并正常工作,只是在启动时超时。现在我根本无法启动该服务。它总是超时。PHP-fpm 本身不生成任何日志。

答案1

哦,天哪,我明白了。

dist-upgrade 以某种方式将 php-fpm 服务移入多用户目标,这是错误的,因为该服务器启动单个用户。

我必须编辑/lib/systemd/system/php7.2-fpm.service并更改这个:

[Install]
WantedBy=multi-user.target

变成这样:

[Install]
WantedBy=default.target

然后运行

systemctl daemon-reload
systemctl start php7.2-fpm

相关内容