我拥有macOS HighSiera10.13.6,我在LaravelValet2.11.0本地运行WordPress站点。昨天,我在本地设置中遇到了一些其他问题,我通过brew更新/升级和很少的其他调整来修复这些问题。从那以后,一切都很好,直到我一夜之间重启了笔记本电脑。现在我得到一个错误"502坏网关nginx/1.19.1“在前端。
我认为这与PHP没有正确链接有关,但无法确定到底出了什么问题。
nginx-error.log文件中的错误:
2020/07/22 22:27:41 [crit] 75400#0: *1 connect() to unix:/Users/klara1/.config/valet/valet.sock failed (2: No such file or directory) while connecting to upstream, client: 127.0.0.1, server: domainname.test, request: "GET /favicon.ico HTTP/2.0", upstream: "fastcgi://unix:/Users/klara1/.config/valet/valet.sock:", host: "domainname.test", referrer: "https://domainname.test/“brew list | grep php
php
php@7.1
php@7.2
php@7.3
which php
/usr/local/opt/php@7.3/bin/php
php -v 7s
PHP 7.3.20 (cli) (built: Jul 10 2020 00:02:14) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.20, Copyright (c) 1998-2018 Zend Technologies
ps ax | grep php
72830 s000 R+ 0:00.00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn php
php --ini
Configuration File (php.ini) Path: /usr/local/etc/php/7.3
Loaded Configuration File: (none)
Scan for additional .ini files in: /usr/local/etc/php/7.3/conf.d
Additional .ini files parsed: /usr/local/etc/php/7.3/conf.d/php-memory-limits.ini当我运行sudo brew services restart nginx && sudo brew services restart php73时,我在最后得到一个错误:
==> Successfully started `nginx` (label: homebrew.mxcl.nginx)
Error: No available formula with the name "php73"brew link php73
Error: No such keg: /usr/local/Cellar/php73
brew info php73
Error: No available formula with the name "php73"
==> Searching for a previously deleted formula (in the last month)...
Warning: homebrew/core is shallow clone. To get complete history run:
git -C "$(brew --repo homebrew/core)" fetch --unshallow
Error: No previously deleted formula found.当运行valet stop时,它将停止两个不同的PHP版本:
valet stop
Stopping php...
Stopping php@7.2...
Stopping php@7.3...
Stopping nginx...
Valet services have been stopped.我已经完成了以下建议的故障排除(https://laracasts.com/discuss/channels/general-discussion/updating-to-php-73):
brew unlink php && brew link php
brew services restart —all
composer global update
valet start另外:
brew update
brew upgrade php另外:
valet install但是没有什么是有效的,…仍然会有同样的错误。有人知道这可能是什么吗?!任何帮助都是非常感谢的!
发布于 2020-07-30 16:54:06
我相信你必须增加你的标题的缓冲区大小,
open Users/YOUR-USER/.config/valet/Nginx/WEBSITE.test
在每一行fastcgi_pass之后添加下面的行
fastcgi_buffers 16 16k;
fastcgi_buffer_size 32k;然后
valet restart祝好运!希望这能有所帮助
发布于 2020-10-20 10:41:49
我把它添加到http /usr/local/etc/nginx/nginx.conf中,这解决了Magento 2的问题,对wordpress也有帮助。
fastcgi_buffering on;
fastcgi_buffers 4 256k;
fastcgi_buffer_size 128k;发布于 2022-01-14 05:44:15
我只需要把我的服务员更新到最新版本:
composer global update
valet installhttps://stackoverflow.com/questions/63043281
复制相似问题