13

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?

Rimian
  • 36,864
  • 16
  • 117
  • 117
ptamzz
  • 9,235
  • 31
  • 91
  • 147
  • where you are testing this code? on device or simulator? – Ravin Apr 14 '11 at 15:58
  • 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 Apr 14 '11 at 15:59
  • 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 Apr 14 '11 at 15:59
  • Here is another solution : http://stackoverflow.com/questions/3132105/how-do-you-access-a-website-running-on-localhost-from-iphone-browser/ – T.Todua Jul 16 '14 at 14:36

3 Answers3

7

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.

kaiser
  • 21,817
  • 17
  • 90
  • 110
Easen
  • 296
  • 1
  • 5
2

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.

wm_eddie
  • 3,938
  • 22
  • 22
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...

aseba
  • 86
  • 6