旧的 LEMP 堆栈 WordPress 网站将不再部署

旧的 LEMP 堆栈 WordPress 网站将不再部署

我继承了一个在 Ubuntu 16.04.3 x64 droplet 上运行的 WordPress 5.7 网站,它使用单独的 DigitalOcean 管理的 MySQL 8 数据库。

WordPress 站点是 Trellis LEMP 堆栈站点。PHP 版本为 7.3,但从 phpinfo() 来看,Nginx 似乎使用的是 7.1。

我知道所有版本都已严重过时并需要更新,但眼下我需要先让一切正常运行。

出现数据库连接错误(请参阅https://www.digitalocean.com/community/questions/since-a-wordpress-url-change-i-can-t-connect-to-do-managed-mysql-database) 这让我尝试了很多不明智的事情,直到现在通过 Trellis 部署到登台站点失败了。

以下是其中的内容:

任务 [部署:重新加载 php-fpm] ********************************************************************************************* 系统信息:Ansible 2.7.0;Linux Trellis 位于“从 .dev 切换到 .test” --------------------------------------------------- 致命:[staging.mywebsite.co.uk]:失败! => {"changed": true, "cmd": "sudo service php7.3-fpm reload", "delta": "0:00:00.030313", "end": "2021-12-21 11:51:06.490541", "msg": "非零返回码", "rc": 1, "start": "2021-12-21 11:51:06.460228", "stderr": "php7.3-fpm.service 未激活,无法重新加载。", "stderr_lines": ["php7.3-fpm.service 未激活,无法重新加载。"], "stdout": "", "stdout_lines": []} 要重试,请使用:--limit @/home/ubuntu/mywebsite.co.uk/trellis/deploy.retry

如果我通过 SSH 登录并尝试启动服务,我会得到

php7.3-fpm.service 的作业失败,因为控制进程退出并显示错误代码。有关详细信息,请参阅“systemctl status php7.3-fpm.service”和“journalctl -xe”。

这是 systemctl status php7.3-fpm.service:

● php7.3-fpm.service - The PHP 7.3 FastCGI Process Manager
   Loaded: loaded (/lib/systemd/system/php7.3-fpm.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Tue 2021-12-21 12:04:49 GMT; 47min ago
     Docs: man:php-fpm7.3(8)
  Process: 1658 ExecStart=/usr/sbin/php-fpm7.3 --nodaemonize --fpm-config /etc/php/7.3/fpm/php-fpm.conf (code=exited, st
 Main PID: 1658 (code=exited, status=78)

Dec 21 12:04:49 ubuntu-xxx-xxx-01 systemd[1]: Starting The PHP 7.3 FastCGI Process Manager...
Dec 21 12:04:49 ubuntu-xxx-xxx-01 php-fpm7.3[1658]: [21-Dec-2021 12:04:49] ERROR: Another FPM instance seems to already
Dec 21 12:04:49 ubuntu-xxx-xxx-01 php-fpm7.3[1658]: [21-Dec-2021 12:04:49] ERROR: FPM initialization failed
Dec 21 12:04:49 ubuntu-xxx-xxx-01 systemd[1]: php7.3-fpm.service: Main process exited, code=exited, status=78/n/a
Dec 21 12:04:49 ubuntu-xxx-xxx-01 systemd[1]: Failed to start The PHP 7.3 FastCGI Process Manager.
Dec 21 12:04:49 ubuntu-xxx-xxx-01 systemd[1]: php7.3-fpm.service: Unit entered failed state.
Dec 21 12:04:49 ubuntu-xxx-xxx-01 systemd[1]: php7.3-fpm.service: Failed with result 'exit-code'.

以及 journalctl -xe:

-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit session-9.scope has finished starting up.
--
-- The start-up result is done.
Dec 21 12:53:07 ubuntu-xxx-xxx-01 sshd[1915]: Received disconnect from 92.0.0.0 port 53386:11: Bye Bye [preauth]
Dec 21 12:53:07 ubuntu-xxx-xxx-01 sshd[1915]: Disconnected from 92.0.0.0 port 53386 [preauth]
Dec 21 12:55:34 ubuntu-xxx-xxx-01 sudo[1919]:     root : TTY=pts/0 ; PWD=/root ; USER=root ; COMMAND=/bin/systemctl sta
Dec 21 12:55:34 ubuntu-xxx-xxx-01 sudo[1919]: pam_unix(sudo:session): session opened for user root by root(uid=0)
Dec 21 12:55:34 ubuntu-xxx-xxx-01 systemd[1]: Starting The PHP 7.3 FastCGI Process Manager...
-- Subject: Unit php7.3-fpm.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit php7.3-fpm.service has begun starting up.
Dec 21 12:55:34 ubuntu-xxx-xxx-01 php-fpm7.3[1922]: [21-Dec-2021 12:55:34] ERROR: Another FPM instance seems to already
Dec 21 12:55:34 ubuntu-xxx-xxx-01 php-fpm7.3[1922]: [21-Dec-2021 12:55:34] ERROR: FPM initialization failed
Dec 21 12:55:34 ubuntu-xxx-xxx-01 systemd[1]: php7.3-fpm.service: Main process exited, code=exited, status=78/n/a
Dec 21 12:55:34 ubuntu-xxx-xxx-01 systemd[1]: Failed to start The PHP 7.3 FastCGI Process Manager.
-- Subject: Unit php7.3-fpm.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit php7.3-fpm.service has failed.
--
-- The result is failed.

我被困住了。我对 Linux 环境不是很有信心,所以说实话我完全不知所措。我想我需要先修复这个问题,然后再修复我的数据库连接错误!

我确实尝试添加 PHP 7.4,但是当我尝试部署网站时,这会产生几页红色错误,所以我将其删除了。

这是一个临时站点,因此并不重要,但显然生产站点具有相同的背景设置,我很害怕它也会崩溃!

从长远来看,我计划升级一切,但真的希望得到一些帮助,以便在短期内让其正常运转。

谢谢!

答案1

它清楚地说,php-fpm7.3由于 而无法启动ERROR: Another FPM instance seems to already。您可能已经php-fpm7.1在运行。

相关内容