Laravel valet does not work

I use OSX El Capitan and PHP 7. I followed the installation guide, so I successfully installed Laravel Valet v1.1.3. I am ping foo.dev or any.dev, then the terminal prints

"64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.116 ms"

Everything is fine. My directory has been /User/mickey/Sitesadded on the path to Valet. I created a Laravel 5.2 project with the name blog, then started the project with php artisan serveok, but when I accessed the blog.dev url in the browser, the browser said

This site could not be reached, blog.dev refused to connect. ERR_CONNECTION_REFUSED.

I do not know what the problem is with my installation. Thanks in advance!

+4
source share
5 answers

php artisan serve, Valet Caddy .

.

  • , Apache ( - , 80)

    sudo apachectl stop

  • , Valet

    valet start

  • , PHP FPM

    brew uninstall homebrew/php/php70

    brew install homebrew/php/php70 --with-fpm

+17

, . Self Control , , !

- httpd, . , 127.0.0.1 80 8080.

Go > ...

/Library/LaunchDaemons/

co.echo.httpdfwd.plist, , Mac. . Laravel Valet . 127.0.0.1 .

, !

+1

. , , .

0

, ( , ) , test.

valet domain test

, , , ping curl .dev , (Chrome Safari). .app, . https valet unsecure.

.test . , , , , .

, .dev , TLD . (wikipedia)

0

, Laravel Valet, Homebrew macOS 10.13 "High Sierra".

, , , DNSMasq , Nginx 80.

:

$ curl -IL http://example.test/
curl: (7) Failed to connect to example.test port 80: Connection refused

macOS 10.2 "Sierra" 10.13 "High Sierra", , Homebrew, , .

, , , Valet (PHP, Nginx, DNSMasq ..):

$ 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 list, I was able to successfully install Valet :

$ brew update
$ brew install homebrew/core/php
$ composer global require laravel/valet
$ valet install

Then I install the new development domain:

$ valet domain test
$ valet park ~/Sites
$ mkdir ~/Sites/example && cd "$_"
$ valet link
$ echo "Hello, world" > ~/Sites/example/index.html

With Valet installed, I confirmed that everything works:

$ valet --version
$ sudo nginx -t
$ ping -c 4 example.test
$ curl -IL http://example.test/
$ valet open example

After doing all this, I had a 100% successful Laravel Valet work environment.

0
source

All Articles