81

I just recently downloaded WAMP Server to view and edit php webpages but now I would also like other people in my network (connected to the same wifi) to be able to access localhost and all the files that I have saved. I have already tried to access localhost and my WAMP server was already online, however that didn't work. Can someone help me out? Thanks in advance!

user2735791
  • 829
  • 1
  • 7
  • 4

2 Answers2

109

You need to find what your local network's IP of that computer is. Then other people can access to your site by that IP.

You can find your local network's IP by go to Command Prompt or press Windows + R then type in ipconfig. It will give out some information and your local IP should look like 192.168.1.x.

mekb
  • 554
  • 8
  • 22
Tri Hoang
  • 1,262
  • 1
  • 9
  • 6
  • 1
    Can you use the computer's hostname instead of IP? – cpage Dec 14 '20 at 13:30
  • 3
    Additionally, make sure your firewall allows incoming connections to your local server. On Windows, you may have already allowed this at install time, but possibly for private networks only. If the connection isn't working, an easy fix might be to ensure your host PC's network connection is set as private, and if it is but the connection still isn't working, take a look at your application firewall settings. – Caleb Miller Jan 30 '22 at 21:55
  • 2
    @CalebMiller your comment helped me! Thanks. – Muhammed Rahif Feb 25 '22 at 15:14
  • Expanding on Caleb's comment, there's three more things you should check if your connection doesn't work: 1. Does your firewall allow outgoing connections on the port you're using? 2. Is there any "Block" rules blocking your program or port in your firewall? 3. Are you sure you have the right IP and port number? – Almenon Apr 08 '23 at 17:20
33

localhost is a special hostname that almost always resolves to 127.0.0.1. If you ask someone else to connect to http://localhost they'll be connecting to their computer instead or yours.

To share your web server with someone else you'll need to find your IP address or your hostname and provide that to them instead. On windows you can find this with ipconfig /all on a command line.

You'll also need to make sure any firewalls you may have configured allow traffic on port 80 to connect to the WAMP server.

Jonathan K
  • 429
  • 3
  • 3