Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Access localhost on a PC from mobile connected using bluetooth/wifi

I want my localhost folder on my pc to be accessible by mobile phone connected using bluetooth/wifi. I am using WAMP. How do I do this?

like image 238
sanesh p Avatar asked Nov 04 '13 06:11

sanesh p


People also ask

How can I access my localhost from my phone?

You can access your host machine with the IP address "10.0. 2.2". This has been designed in this way by the Android team. So your webserver can perfectly run at localhost and from your Android app you can access it via "http://10.0.2.2:8080".

How do I access localhost?

To access the server from itself, use http://localhost/ or http://127.0.0.1/ . To access the server from a separate computer on the same network, use http://192.168.X.X where X.X is your server's local IP address. You can find the sever's local IP address (assuming it's Linux) by running hostname -I . 127.0.


2 Answers

Here's a guide how to access your website through mobile:

http://www.logicspot.com/web-development-2/viewing-a-locally-hosted-website-with-your-smartphone/

like image 28
sleepless_in_seattle Avatar answered Oct 09 '22 09:10

sleepless_in_seattle


Since you are using WAMP. This is possible.

Just click your WAMP icon on your system tray and choose the option "Put Online".

After doing so, go to your command prompt (Start -> Run -> Cmd [Press Enter] ) . Now type the command ipconfig. You will see your system's IP. Make note of that IP. Say your IP is 192.XXX.XXX.XX.

Now you can access your localhost files as http://192.XXX.XXX.XX/myfile.php which is synonymous to http://localhost/myfile.php

This URL can be accessed even from outside world. So be cautious ! :)

like image 94
Shankar Narayana Damodaran Avatar answered Oct 09 '22 10:10

Shankar Narayana Damodaran