问题
Trying to get the valet setup working. It appears when accessing 127.0.0.1 the connection is refused which is the message I get when I go to one of the *.dev sites setup. I've made sure apache is stopped and have been Googling all over the place and unable to find a solution.
Has anyone come across this or have any ideas on what to try next? I previously had httpd22 installed but I've now uninstalled this with brew which changed the 127.0.0.1 from responding with a list directory of /Users/Rick/Sites to now connection refused.
回答1:
Fixed this. I followed a guide a while back to get a local dev setup and the issue was I had a .plist xml file within /Library/LaunchDaemons that forwarded port 80 to 8080 for 127.0.0.1.
The Run with Port 80 on this guide has caused me hours time trying to solve this one haha:
https://echo.co/blog/os-x-109-local-development-environment-apache-php-and-mysql-homebrew
回答2:
I had a similar connection issue between Valet and Nginx and fixed it by manually uninstalling and reinstalling Valet, found in this Stack Overflow answer:
$ rm -rf ~/.valet
$ brew unlink nginx && brew remove nginx
$ brew unlink php56 && brew remove php56 && brew uninstall --ignore-dependencies php56
$ brew unlink php72 && brew remove php72
$ brew unlink dnsmasq && brew remove dnsmasq
With a clean slate, I was able to successfully install a working Valet environment.
来源:https://stackoverflow.com/questions/38338710/laravel-valet-not-working-127-0-0-1-connection-refused