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

后端 未结 24 3123
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-22 14:01

I have just set up a wi-fi network at home. I have all my files on my desktop computer (192.168.1.56) and want to access localhost over there from another computer (192.168.

相关标签:
24条回答
  • 2020-11-22 14:17

    it's very easy

    1. Go to Your XAMPP Control panel
    2. Click on apache > config > Apache (httpd.conf)
    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)
    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
    0 讨论(0)
  • 2020-11-22 14:17

    These are the steps to follow when you want your PHP application to be installed on a LAN server (not on web)

    1. Get the internal IP or Static IP of the server (Ex: 192.168.1.193)
    2. Open XAMPP>apache>conf>httpd.conf file in notepad
    3. Search for Listen 80
    4. Above line would read like- #Listen 0.0.0.0:80 / 12.34.56.78:80
    5. Change the IP address and replace it with the static IP
    6. Save the httpd.conf file ensuring that the server is pointed to #Listen 192.168.1.193:80
    7. In the application root config.php (db connection) replace localhost with IP address of the server

    Note: If firewall is installed, ensure that you add the http port 80 and 8080 to exceptions and allow to listen. Go to Control Panel>Windows Firewall>Allow a program to communicate through windows firewall>Add another program Name: http Port: 80 Add one more as http - 8080

    If IIS (Microsoft .Net Application Internet Information Server) is installed with any Microsoft .Net application already on server, then it would have already occupied 80 port. In that case change the #Listen 192.168.1.193:80 to #Listen 192.168.1.193:8080

    Hope this helps! :)

    0 讨论(0)
  • 2020-11-22 14:17

    Host in local IP,

    Open CMD : ipconfig

    Wireless LAN adapter Wi-Fi: IPv4 Address. . . . . . . . . . . : xx.xxx.xx.xxx

    0 讨论(0)
  • 2020-11-22 14:19

    Go to xampp-control in the Taskbar

    xampp-control -> Apache --> Config --> httpd.conf
    

    Notepad will open with the config file

    Search for

    Listen 80

    One line above it, there will be something like this: 12.34.56:80

    Change it

    12.34.56:80 --> <your_ip_address eg:192.168.1.5>:80
    

    Restart the apache service and check it, Hopefully it should work...

    0 讨论(0)
  • 2020-11-22 14:20

    First Go To Network and Sharing center of your windows machine.and Just follow some steps to get your IPv4 address.

    Put the IPv4 adress on another computer browser. example,http//192.168.0.102

    Note

    • Turn Of Your Windows Firewall (if does not work,otherwise its optional)
    0 讨论(0)
  • 2020-11-22 14:23

    Replace Require Local with Require all granted in xampp\apache\conf\extra\httpd-xampp.conf file.

    0 讨论(0)
提交回复
热议问题