Jump to content

Check out our Community Blogs

Register and join over 40,000 other developers!

Recent Status Updates

View All Updates

- - - - -

Localhost/index.php Through Wifi

wifi localhost

  • Please log in to reply
3 replies to this topic

#1 xle_camry


    CC Addict

  • Advanced Member
  • PipPipPipPipPip
  • 170 posts

Posted 21 April 2012 - 11:18 PM

Dear friends,

I have a problem with connecting to my localhost through wifi.

I want to connect to my localhost through my smart phone by wifi.

At whatismyip.com, I got my ip.

Then I connected through my smart phone to my laptop successfully.

And now, in the browser I am writing my localhost ip, but it does not show anything.

How can I access my localhost/index.php page through my smart phone?

Kind Regards,

Learning programmer.
  • 0

#2 Orjan


    CC Mentor

  • Moderator
  • 2918 posts
  • Location:Karlstad, Sweden
  • Programming Language:C, Java, C++, C#, PHP, JavaScript, Pascal
  • Learning:Java, C#

Posted 22 April 2012 - 12:15 AM

You need to make sure your webserver answers not only for localhost, but also on usual ip address. Also, if you have a router, you need to set it to let your port 80 through to your pc.
  • 0

I'm a System developer at XLENT Consultant Group mainly working with SugarCRM.
Please DO NOT send mail or PM to me with programming questions, post them in the appropriate forum instead, where I and others can answer you.

#3 WingedPanther73


    A spammer's worst nightmare

  • Moderator
  • 17757 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others

Posted 22 April 2012 - 06:15 AM

For all devices, "localhost" is the device itself. So for your smartphone, "localhost" is the smartphone. For the computer, "localhost" is the computer.

With all that said, if you're on the local network, using whatismyip.com won't help you any. If you're outside the local network, it will.

I know from experience that Apache defaults to ONLY accepting requests from localhost (the device itself). So, you have to consider the server configuration as a factor.
  • 0

Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

My MineCraft server site: http://banishedwings.enjin.com/

#4 lethalwire


    while(false){ ... }

  • Senior Member
  • PipPipPipPipPipPip
  • 766 posts
  • Programming Language:C, Java, PHP, JavaScript
  • Learning:PHP

Posted 22 April 2012 - 11:34 AM

Well, after your devices connects to the local network, it will be assigned a local ip address.

For instance, on my network, the address look something similar to:
So the HOST could be on

When your device connects it will probably be given an ip address of something similar to:;
Typing in localhost to the browser would just point you right back towards

To get to the HOST, you'll need to type the following into your browser:

**Depending on the network.
  • 0

Also tagged with one or more of these keywords: wifi, localhost

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download