0

I'm using laravel valet for years and I had several times problems with 502 Bad Gateway now I have it after I removed PHP 7.4 and installed PHP 8.1. Usualy this problem can be solved by doing valet install but now it doesn't work.

My valet version is 3.0x, at the moment on the latest version, I installed PHP 8.1 and linked it with brew link php@8.1 --force and valet use php@8.1 --force.

One of the possible solutions was uninstall valet and nginx completely with his configuration and install it again but it still doesn't work, I also tried multiple times restarting valet and running valet install again but none of these ways works, read multiple times ideas on stackoverflow solutions but none of them works.

Does anybody has any idea what still could be wrong with setup after uninstalling/installing PHP?

Maxi B
  • 1
  • 1
  • 2
  • 1
    this `laravel/valet` issue might be helpful: https://github.com/laravel/valet/issues/1019 –  Apr 18 '22 at 09:56
  • I tried all those thinks, even downgrade back to php7.4 bad the problem still exists. – Maxi B Apr 18 '22 at 12:46
  • what is your nginx `error.log` contents after `php7.4` downgrade and same "502 Bad Gateway" response? –  Apr 18 '22 at 13:02
  • Doesn't matter downgrade or upgrade I get `[crit] 6014#0: *24 connect() to unix:/path/.config/valet/valet.sock failed (2: No such file or directory) while connecting to upstream, client: 127.0.0.1, server: project.test, request: "GET / HTTP/2.0", upstream: "fastcgi://unix:/Users/worksmb/.config/valet/valet.sock:", host: "profiles20222.test"` – Maxi B Apr 18 '22 at 18:56
  • did you re-run `valet install` after downgrading php to php7.4? And did you execute `valet use php@7.4` after that re-installing procedure? –  Apr 18 '22 at 19:00
  • 1
    I did everything but thank you for your hint regarding error logs, thanks to that I found solution and it's: https://github.com/laravel/valet/issues/441#issuecomment-895954595 – Maxi B Apr 18 '22 at 19:06

0 Answers0