Accessing localhost (xampp) from another computer over LAN network - how to?

Localhost is just a name given for the loopback, eg its like referring to yourself as "me" ..

To view it from other computers, chances are you need only do http://192.168.1.56 or http://myPcsName if that doesnt work, there is a chance that there is a firewall running on your computer, or the httpd.conf is only listening on 127.0.0.1


it's very easy

  1. Go to Your XAMPP Control panel
  2. Click on apache > config > Apache (httpd.conf) enter image description here
  3. Search for Listen 80 and replace with Listen 8080
  4. After that check your local ip using ipconfig command (cmd console)
  5. Search for ServerName localhost:80 and replace with your local ip:8080 (ex.192.168.1.156:8080)
  6. After that open apache > config > Apache (httpd-xampp.conf) enter image description here
  7. Search for

       <Directory "C:/xampp/phpMyAdmin">
           AllowOverride AuthConfig
           **Require local**   Replace with   **Require all granted**
           ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
       </Directory>```
    
    
  8. Go to xampp > config > click on service and port setting and change apache port 8080

  9. restart xampp
  10. then hit your IP:8080 (ex.192.168.1.156:8080) from another computer

Thanks for a detailed explanation.

Just to Elaborate, in Windows, Go to Control Panel -> Firewall, in exceptions "add http and port 80". Then in Services check mark "http (web server port 80)" and "https (web server port 443)" ONLY if you need https to work also. Ok, OK, Close

Then go to any computer on network and type http://computer-name (where you change the firewall and has the xampp running on it) in your web browser and happy days :)