0

Usually I use the method of this post to connect my mobile devices to my local dev server but I changed flats and it doesn't seem to work anymore. I seem to be doing everything right:

run server:

php artisan serve --host 0.0.0.0

check server ip (mac):

ipconfig getifaddr en0

browse ip + port on mobile device:

https://192.168.179.125:8000

Iphone shows:

This site can't be reached

Am I missing permissions or something?

Artur Müller Romanov
  • 4,417
  • 10
  • 73
  • 132
  • Is the port correct? On the dev server, can you get to `http://localhost:8000` in the browser? Is the phone and server on the same network (eg wifi)? – Phil Mar 16 '22 at 05:46
  • Hello, the port is `8000` and correctly recalled by the mobile device. `http(s)://localhost:8000` can't be reached. Both devices are on the same wifi network. – Artur Müller Romanov Mar 16 '22 at 06:10
  • It's unlikely you're running your app with an SSL certificate. You'll need to use `http://` only – Phil Mar 16 '22 at 06:29
  • Yes, I tried both and none of them work. – Artur Müller Romanov Mar 16 '22 at 06:47
  • So where did you try `http://localhost:8000`? On what device, PC, etc? If that doesn't work when tried from the machine running the server, then the server ain't running (at least not on port 8000) – Phil Mar 16 '22 at 06:50
  • who provide the wifi? is it the pc or a router? some router protects devices by filtering connections to the other devices within the same network. did your pc firewall allows for incoming connection to 8080? as firewall might cause your pc to refuse connection on that particular port. – Bagus Tesa Mar 16 '22 at 07:19
  • 1
    @Phil I tried it to connect from the `Iphone` to the `Macbook Air` on which the server is running. The server is running. I can open it on the `Macbook` via `http://192.168.179.125:8000` – Artur Müller Romanov Mar 16 '22 at 07:26
  • @BagusTesa The wifi is provided by a router. I'm on a mac. Why would it be port `8080` and not `8000`? – Artur Müller Romanov Mar 16 '22 at 07:27
  • mybad, should be `8000`. that being said, those are items you need to check @ArturMüllerRomanov. at least check the firewall. though, for easier life, try to have your mac broadcast a wifi, then connect your phone to it and try to access the address. at least, it will reduce the items you need to check - router. – Bagus Tesa Mar 16 '22 at 07:31
  • @BagusTesa I've never broadcasted a wifi via mac. I'll try that out – Artur Müller Romanov Mar 16 '22 at 07:40
  • Ok, so if you try `http://192.168.179.125:8000` on your iPhone, does it work? Make sure it doesn't try `https://` – Phil Mar 16 '22 at 07:58
  • @Phil no it doesn't `http` and `https` show that the page can't be reached – Artur Müller Romanov Mar 16 '22 at 20:30

0 Answers0