Accessing localhost from iPhone (in same network)

落花浮王杯 提交于 2019-12-09 02:56:18

问题


I want to test my iPhone web Application developed in localhost (XAMPP) in my iPhone. My system IP is 192.168.1.1 in the local network.

When I visit http://192.168.1.1:80 in the browser, it says "The server 192.168.1.1:80 at DSL Router requires a username and password".

I thought it must be my XAMPP username/password but it seems it is not and it shows a 404 error.

Both my system and my iPhone are in the same network. So where am I doing it wrong?


回答1:


Check to make sure your IP is correct for your host machine.

Windows: Windows + R -> type "cmd"

ipconfig

*unix:

ifconfig

Usually 192.168.0.1 or 192.168.1.1 are allocated to your router, which is what you are seeing via your iPhone.




回答2:


Are you sure the IP of your computer is 192.168.1.1 ? It seems like 192.168.1.1 is your DSL router.

In that case, maybe XAMPP is asking for password?

Other reason may be that your router is not letting lan computers access each other...




回答3:


192.168.1.1 sounds like it's your router's IP not your Mac's. Try running ifconfig in a terminal to find out your Mac's actual IP address. It's probably something like 192.168.1.2.



来源:https://stackoverflow.com/questions/5666018/accessing-localhost-from-iphone-in-same-network

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!