0

I had this working a while ago but it stopped for some reason.

What I want is to access the dev serve on LAN or public IP.

I could do it by serving php artisan serve --host 0.0.0.0.

ifconfig sais inet 192.168.0.150 netmask 255.255.255.0 broadcast 192.168.0.255

I would port forward 192.168.0.150 on port 8000 and voila, I could connect on my phone from http://192.168.0.150:8000 or the publicIP:8000. Now none work.

If I try http://192.168.0.150:8000 on the PC that I serve, it works, but on my phone connected to the WiFi it sais Could not connect to the server. NSURLErrorDomain

What changes I did in the past days was to remove apache2 and install nginx, but I don't think it had anything to do with artisan.

alex
  • 51
  • 5

1 Answers1

0

If you can load your application directly (on localhost) with your LAN IP, then this seems not to be a Laravel issue.

Instead, check your firewall config. Make sure the port 8000 is opened on the local firewall for inbound traffic.

And it is highly not recommended to open a port in your router to access the application to the WAN / internet.