我继承了在 Ubuntu 16.04.3 x64 droplet 上运行的 WordPress 5.7 站点,该站点使用单独的 DigitalOcean 管理的 MySQL 8 数据库。
WordPress 站点是一个 Trellis LEMP 堆栈站点。PHP 版本 7.3,但 Nginx 似乎正在使用 phpinfo() 中的 7.1。
我知道所有版本都严重过时并且需要更新,但在非常近期内,我需要首先让事情正常工作。
出现数据库连接错误(请参阅https://www.digitalocean.com/community/questions/since-a-wordpress-url-change-i-can-t-connect-to-do-managed-mysql-database)这涉及到我尝试了很多不明智的事情,直到现在通过格子部署到临时站点失败。
它是这样说的:
任务 [部署:重新加载 php-fpm] ***************************************** ************************************************ 系统信息:Ansible 2.7.0;“从 .dev 切换到 .test”中的 Linux Trellis -------------------------------------------------- ------------- 致命:[staging.mywebsite.co.uk]:失败!=> {“更改”: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”:
如果我 SSH 并尝试启动我得到的服务
php7.3-fpm.service 的作业失败,因为控制进程以错误代码退出。有关详细信息,请参阅“systemctl status php7.3-fpm.service”和“journalctl -xe”。
这是 systemctl 状态 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,但是当我尝试部署站点时,这会产生几页红色错误,因此我将其删除。
这是一个临时站点,所以它并不重要,但显然生产站点具有相同的背景设置,我很害怕它也会崩溃!
从长远来看,我计划升级所有东西,但真的很想得到一些帮助,以使其在短期内正常工作。
谢谢!