502 错误网关 nginx 1.20.1

502 错误网关 nginx 1.20.1

我知道为什么会发生这种情况。但我不知道如何修复它。我按照这篇文章安装 osticket。 https://www.vultr.com/docs/how-to-install-osticket-on-centos-7/ 事实证明,当前的 osticket 需要 php 8.0+。然后我使用以下命令删除了 php 7.4

yum -y remove php*

现在,我使用这个安装了 php 8.x+

# yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
# yum install https://rpms.remirepo.net/enterprise/remi-release-7.rpm
# yum install -y --enablerepo=remi-php80 php php-cli

现在我打开服务器时出现 502 错误网关。

我环顾四周,认为这可能是因为我没有使用这个命令。

$ sudo systemctl enable php-fpm.service

因此,我尝试这样做,但失败了。

Failed to execute operation: No such file or directory

我很失望。我该如何解决这个问题?

2023/09/12 14:06:58 [error] 993#993: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 10.13.165.134, server: example.com, request: "GET /setup/install.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "10.13.165.100"

这就是我的 nginx error.log 所说的内容。

答案1

从上面提供的命令来看,你没有安装 php-fpm。你需要运行

yum install --enablerepo=remi-php80 php-fpm

相关内容