12
votes

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?

3
where you are testing this code? on device or simulator?Ravin
When you say "System IP", what do you mean? I would highly doubt that your iPhone has that IP address, unless you specifically assigned it to it, which, if you did, you should change as you are in conflict with your router.Frank Bozzo
You are likely looking at the Gateway IP address, which will normally be your router or switch. Unfortunately you are likely on a MAC and I am not sure what the equal of window's ipconfig command would be.James
Here is another solution : stackoverflow.com/questions/3132105/…T.Todua

3 Answers

7
votes

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
votes

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...

1
votes

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.