beyondcode / herd-community

89 stars 1 forks source link

[Bug]: Can't open particularly Laravel site. #1125

Closed bpikaar closed 1 week ago

bpikaar commented 2 weeks ago

Platform

macOS

Operating system version

macOS Sonoma 14.7.1

System architecture

Intel (x86)

Herd Version

1.11.2

PHP Version

No response

Bug description

I have multiple Laravel sites, but the one i use the most won't open in Herd. I followed the uninstall of Herd en reinstalled the Herd app. I tried to switch PHP versions, node version and to give more memory to nginx. Unlinked and relinked again. noting seems to work. I keep getting a 502 Bad Gateway error.

Steps to reproduce

No response

Relevant log output

upstream prematurely closed connection while reading response header from upstream, client: 127.0.0.1, server: site.test, request: "GET /?herd=preview HTTP/2.0", upstream: "fastcgi://unix:/Users/.../Library/Application Support/Herd/herd82.sock:", host: "site.test"
bpikaar commented 1 week ago

I had valet running and the site is working under valet. Also the website has Telescope running, this works under Herd. The home page will not load under Herd.

sschlein commented 1 week ago

What happens if you either change the directory name so that it's under a different domain or use herd link and link it via a different domain?

Any ideas what's different with this site compared to all others?

bpikaar commented 1 week ago

It crashes on this line of code:

setlocale(LC_ALL, env('APP_LOCALE'));

APP_LOCALE was not set in my .env file, which caused the error.

sschlein commented 1 week ago

If you set this, the DNS error goes away?

bpikaar commented 1 week ago

Yes, I can now access the website as usual. After researching missing .env settings, I found that a 502 (Bad Gateway) error is commonly associated with this issue. In my case it was harder to find because there were no errors in the log and no error message from Laravel.

sschlein commented 1 week ago

Ok, sounds like it's not a Herd bug and we can close the issue here :)