Laravel valet not working

metylbk picture metylbk · May 10, 2016 · Viewed 25.8k times · Source

I use OSX El Capitan and PHP 7. I followed the installation guide so I install Laravel Valet version v1.1.3 successfully. I 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 ok. My directory /User/mickey/Sites is added to Valet's paths. I created a Laravel 5.2 project named blog, then run the project with php artisan serve ok but when i accessed url blog.dev on the browser, the browser said

This site can’t be reached, blog.dev refused to connect. ERR_CONNECTION_REFUSED.

I don't know what is the problem with my installation. Thanks in advance!

Answer

Ben Swinburne picture Ben Swinburne · May 11, 2016

You needn't run php artisan serve as Valet runs Caddy in the background.

Here're a few troubleshooting points.

  • Ensure that you don't have Apache (or anything else running on port 80)

    sudo apachectl stop

  • Ensure that Valet is running

    valet start

  • Ensure that PHP was installed with FPM

    brew uninstall homebrew/php/php70

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