XAMPP ACCESS FROM NETWORKED PCs

Problems with the Windows version of XAMPP, questions, comments, and anything related.

XAMPP ACCESS FROM NETWORKED PCs

Postby Ronb1949 » 01. September 2023 08:06

I have XAMPP running on a desktop computer (ASUS). I want to be able to run html/php software on another computer (LENOVO) which accesses the database running under XAMPP on ASUS. The two computers are on the same WiFi network - that of my NBN router. What IP addresses should I use in the php code that accesses the database, and in entering the address of the html file - 127.0.0.1 or localhost or 192.168.20.5 which is what appears as the IPV4 of the ASUS when I run ipconfig from the command line.

Thanks
Ronb1949
 
Posts: 4
Joined: 25. July 2021 05:00
XAMPP version: x3.3.0
Operating System: Windows 10

Re: XAMPP ACCESS FROM NETWORKED PCs

Postby Nobbie » 01. September 2023 11:08

Its not 100%ly clear, what you mean with "run php/ html on another computer". Does it mean, the php/ html are stored on the other computer, or do you mean you want to start a browser on the other computer and see the php/html output in the other computer? Where are these files stored?
Nobbie
 
Posts: 13176
Joined: 09. March 2008 13:04

Re: XAMPP ACCESS FROM NETWORKED PCs

Postby Ronb1949 » 02. September 2023 02:40

Sorry my description is not very clear. I have xampp running on the ASUS with an HTML/JS file in a subdirectory in its htdocs folder and a php file in another subdirectory. The HTML/JS file accesses a mysql database running under xampp via xmlhttp access via the php file. I need the other PC to run a copy of the same HTML/JS file accessing the same database - the idea is to show images on both PCs that are stored on the ASUS - not necessarily the same image on both PCs.
Hope that makes it a bit clearer. I hope the terminology is near enough for people to work out what I'm trying to do - I'm only an amateur web developer!

Thanks
Ronb1949
 
Posts: 4
Joined: 25. July 2021 05:00
XAMPP version: x3.3.0
Operating System: Windows 10

Re: XAMPP ACCESS FROM NETWORKED PCs

Postby Nobbie » 02. September 2023 12:19

Why do you want to copy that HTML file to LENOVO? Instead you can request it in your browser (on LENOVO) via the IP of ASUS: http://192.168.20.5/subfolder/myfile.html (or similar).

If you want to run and request HTML files via http Protocoll from LENOVO, you need to install another Apache onto LENOVO. You cannot request a file from LENOVO from Xampp on ASUS. That does not work. BUT: if you dont need PHP but only HTML at all on LENOVO, you also could request the HTML in your browser NOT using http Protocoll, but instead opening the HTML file direct from the local (LENOVO) path. That is called "file:" protocoll and would look like this in the browser:

file:///C:/anyfolder/somewhere/on/lenovo/myfile.html

You can achieve this also by simply double clicking on myfile.html in an Explorer OR use "Open...." menu entry in the local LENOVO browser. In the case, you run a copy of HTML stored on LENOVO, you must apply 192.168.20.5 as database server in the xmlhttp code. You cannot use "localhost" or 127.0.0.1 there (as you do on ASUS).

But still, what is the idea of running a copy of myfile.html on LENOVO? Why not running http://192.168.20.5/subfolder/myfile.html instead (in that case you dont need to change anything, probably you might add certain rules to the ASUS firewall, as the Windows firewall usually blocks incoming requests).
Nobbie
 
Posts: 13176
Joined: 09. March 2008 13:04

Re: XAMPP ACCESS FROM NETWORKED PCs

Postby Ronb1949 » 04. September 2023 07:42

Thanks Nobbie! It's all working now exactly as I want. I think I had tried accessing xampp on ASUS from LENOVO previously but it didn't work - probably a matter of getting the addresses right!

Thanks again & best wishes
Ronb1949
 
Posts: 4
Joined: 25. July 2021 05:00
XAMPP version: x3.3.0
Operating System: Windows 10


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 173 guests