mobilexampplocalhosthotspot

XAMPP - Share my PC localhost on mobile hotspot to any devices


I wanted to try localhost in my mobile, so I can see if it is really responsive cause in the chrome there are only few selections like iPad,etc.. so My PC has a mobile hotspot. Is it possible to share my localhost to the connected devices?


Solution

  • Why are you using your PC as mobile hotspot? Isn't there another network that both your PC and other devices can connect to and find each other on?

    Either way, localhost is just a shorthand for the local loopback IP address (127.0.0.1), which is used for a computer to handle network requests to itself. Now, if the other devices can connect to the PC, then all you need to do is find out what your IP address on the local network is, if XAMPP's Apache server is listening for requests on the network and if any local Firewall isn't blocking access.

    (Windows)Before you do anything else, make sure Windows IIS isn't running! It occupies the default http port (80) and is going to cause problems if it's there!

    First up, figuring out your IP address:

    Next, check to see if Apache is listening

    Finally, you can't reach it so check if your firewall is blocking access. This is usually Windows firewall not trusting anything that doesn't carry a Microsoft label

    If it still doesn't work and you're running Windows, refer to this Stack Overflow question as you are not the first person that has trouble setting things up.