在 php8.0 中使用 Eloquent 时 Laravel Valet 502 Bad Gateway

在 php8.0 中使用 Eloquent 时 Laravel Valet 502 Bad Gateway

我在 Valet 中有一个 Laravel 6 应用程序,我刚刚升级到 php8.0,并且收到 502 Bad Gateway 错误。但奇怪的是,只有在使用 Eloquent 数据库模型的页面上,数据库查询构建器页面似乎运行良好。

如果我查看 nginx-error.log,我会发现很多以下错误:

2022/10/18 10:05:09 [error] 8175#0: *1 upstream prematurely closed connection while reading response header from upstream, client: 127.0.0.1, server: website.test, request: "GET / HTTP/2.0", upstream: "fastcgi://unix:/Users/<username>/.config/valet/valet80.sock:", host: "website.test", referrer: "https://website.test/downloads/manage"

任何帮助都非常感谢!

答案1

最终原因是因为我有一个与 php8 不兼容的包,有问题的包是 sofa\eloquence。

相关内容