2

valet is not working after I updated php from 7.3 to 7.4. I already tried to reinstall valet, php, nginx and dnsmasq but it's still not working. Now the ngix server is running but I can't acces to my projects. I get the error 502 Bad Gateway for every project url.

The services are running but brew services dont show the correct status.

dnsmasq       unknown root      /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
gitlab-runner started user      /Users/user/Library/LaunchAgents/homebrew.mxcl.gitlab-runner.plist
mysql@5.7     started user      /Users/user/Library/LaunchAgents/homebrew.mxcl.mysql@5.7.plist
nginx         unknown root      /Library/LaunchDaemons/homebrew.mxcl.nginx.plist
php           error   root      /Library/LaunchDaemons/homebrew.mxcl.php.plist
php@7.4       unknown root      /Library/LaunchDaemons/homebrew.mxcl.php@7.4.plist
redis         started user      /Users/user/Library/LaunchAgents/homebrew.mxcl.redis.plist

Nginx error log

2021/01/27 16:35:21 [crit] 35081#0: *1 connect() to unix:/Users/user/.config/valet/valet.sock failed (2: No such file or directory) while connecting to upstream, client: 127.0.0.1, server: , request: "GET /favicon.ico HTTP/1.1", upstream: "fastcgi://unix:/Users/user/.config/valet/valet.sock:", host: "devtest.test", referrer: "http://devtest.test/"
  • Hmm, it doesn't create the socket that is why you get the `502` error. Any error when you run `valet restart`? If that doesn't help I would recommend [Reinstalling Valet](https://tommcfarlin.com/when-valet-stops-working/) – codedge Jan 27 '21 at 16:21
  • I followed the guide. Still not working. Pages are loading endless. The status of the services dnsmasq, ngin, php, php@7.4 and redis are error now – dfgdghjezfghfgdh Jan 27 '21 at 16:47
  • I'm having pretty much the same problem after updating from php7.4 to php8.0. I've tried uninstalling and reinstalling php, nginx, dnsmasq, valet... the whole lot. No luck so far. – Jon White Feb 06 '21 at 19:50

1 Answers1

3

I've managed to get mine working again.

I started by doing a full wipe down following the instructions that valet gives when you run valet uninstall which involved removing valet and all associated config, uninstalling php, nginx and dnsmasq via brew and cleaning up all remaining config. I then reinstalled everything, reconfigured my sites in valet and tried to load one up. Still I got the 502 Bad Gateway error.

I eventually tried running valet use php to make sure it was correctly bound to the right php version. Valet claimed that is was but I ran it again with the force flag just in case valet use php --force.

After that I was up and running again. Hopefully this might help you too.

What's strange is that my brew services list output lists dnsmasq, nginx and php as status unknown but they do all seem to be running correctly. I can't work out what's happening there but at least everything seems to be working again now.

Jon White
  • 682
  • 4
  • 12