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 bad gateway。

我環顧四周,認為這可能是因為我沒有使用這個指令。

$ 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

相關內容