Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel serve getting ERR_CONNECTION_REFUSED on localhost

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

like image 554
Daniel Campos Avatar asked Nov 03 '16 22:11

Daniel Campos


1 Answers

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
like image 153
Daniel Campos Avatar answered Oct 21 '22 18:10

Daniel Campos