Laravel serve getting ERR_CONNECTION_REFUSED on localhost

Daniel Campos picture Daniel Campos · Nov 3, 2016 · Viewed 22.8k times · Source

I'm having an issue with my local laravel server. I'm building an API, and I need to test from another device, but the only url which is working is:

localhost:8000

If I try

127.0.0.1:8000

or using my machine local IP

192.168.0.6:8000

I have a ERR_CONNECTION_REFUSED from chrome (I tried with safari too). There is no 'blocking' extensions

enter image description here enter image description here

Answer

Daniel Campos picture Daniel Campos · Nov 3, 2016

I found the answer: artisan serve isolates the host, so if I want to specify it, I need to do:

php artisan serve --host=127.0.0.1