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

后端 未结 24 3386
爱一瞬间的悲伤
爱一瞬间的悲伤 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

    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! :)

提交回复
热议问题