1

I have a XAMPP-hosted MySQL database on one computer, and I can access it on this computer using the other computer's IP address. There's a couple of php files that I can use to interact with the database, and they work fine on this computer. However, in the same directory as those php files (xampp/htdocs/demo/) I want to add another php file, but I want to build it on this computer. There's tons of stuff out there on accessing localhost on another computer (which I can do no problem) but not much on modifying the localhost directory from another computer.

So, is either of these two things possible:

  1. Actually adding a php file to the localhost directory from this computer (ideal) OR

  2. Creating a php file on this computer (not on localhost) that can still access and modify my database.

3
  • You could use SFTP to transfer the file from your machine to the target machine. Just needs SFTP or SSH server running on the target machine, to accept connections. Or you could use a network fileshare, if security is less of an issue. Commented May 16 at 22:29
  • Localhost only exists on the computer you're on right this second. If you move to another computer, then your old localhost is not available as localhost. You'd have a new localhost on the machine you're on now. There's a reason that the word local is in localhost. Commented May 16 at 22:38
  • @KenWhite Yes, I know it's not called localhost on this computer. I just used the name to refer to the other computer for consistency's sake. Sorry for any confusion! Commented May 16 at 23:26

1 Answer 1

2

If your goal is to place a PHP file into the htdocs folder of another computer's XAMPP, here are your options:

Use File Sharing (SMB / Windows Share)

On the XAMPP host machine (the one running Apache/MySQL):

Share the htdocs directory:

Right-click C:\xampp\htdocs → Properties → Sharing → Share with specific people → Give your user read/write access.

From your development computer:

Open the shared folder via \\[IP address]\htdocs

Copy/edit PHP files directly.

Now you're directly modifying files that the XAMPP server will run.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.