DEV Community

Cover image for Developing a PHP Project Across Windows and Mac on Your Home Network
Nhat Truong Hoang (Justin)
Nhat Truong Hoang (Justin)

Posted on

Developing a PHP Project Across Windows and Mac on Your Home Network

Scenario:
You're developing a PHP application on a Windows desktop using XAMPP. You want to work on the same project from a MacOS machine on your home network without installing XAMPP or any dependencies on the Mac.

What We'll Accomplish:
This guide covers two main tasks:

  1. Giving your Mac access to the project folder on Windows
  2. Giving your Mac access to phpMyAdmin running on Windows

Part 1: Enable File Sharing (Mac Access to Project Folder)

Step 1: Locate Your Project Folder

Ensure your project is in the XAMPP htdocs folder.

  • Example path: C:\xampp\htdocs\project

Step 2: Share the Folder on Windows

  1. Right-click the project folder and select Properties
  2. Go to the Sharing tab
  3. Click Advanced Sharing
  4. Check "Share this folder"
  5. Click Permissions and grant Full Control to ensure the Mac can read and write files

Step 3: Connect from Mac

  1. On your Mac, press Cmd + K
  2. Enter the Windows machine's IP address in this format: smb://[IP_ADDRESS]
    • Find the Windows IP by opening Command Prompt and typing ipconfig
  3. When prompted, enter your Windows username and password
    • Find your username by typing whoami in Command Prompt
    • Important: Your Windows account must have a password. If it doesn't, go to Windows Settings → Accounts and set one

Step 4: Open the Project on Mac

  1. Open VS Code (or your preferred text editor)
  2. The shared Windows folder will appear in Finder's sidebar under "Network" or "Locations"
  3. Open the project from this shared location

Part 2: Enable Database Access (Mac Access to phpMyAdmin)

Now that your Mac can edit files, you also need database access to make changes and view data. This requires configuring the Windows Firewall.

Step 1: Start XAMPP Services

  1. Open XAMPP as Administrator
  2. Start Apache and MySQL services

Step 2: Configure Windows Defender Firewall

  1. Type "Windows Defender Firewall" in the Windows search bar
  2. Click "Allow an app or feature through Windows Defender Firewall" in the left sidebar

Step 3: Allow Apache Through Firewall

  1. Click "Change settings"
  2. Find Apache HTTP Server and Apache HTTPS Server in the list
  3. Check both boxes, but only enable "Private" (since you're on a home network)

Step 4: Configure Inbound Rules

  1. Return to the Windows Defender Firewall main page
  2. Click "Advanced settings" in the left sidebar
  3. Select "Inbound Rules"

Step 5: Enable Required Ports

Ensure ports 80 (HTTP) and 443 (HTTPS) are:

  • Enabled
  • Set to allow connections from all remote hosts

Step 6: Find Your Windows IP Address

Open Command Prompt and type ipconfig. Note down the IPv4 address.

Step 7: Access phpMyAdmin from Mac

  1. Open a browser on your Mac
  2. Enter: http://[WINDOWS_IP_ADDRESS]/phpmyadmin
    • Example: http://192.168.1.100/phpmyadmin

Testing Your Setup

To verify everything works:

  1. Open a browser on your Mac
  2. Navigate to: http://[WINDOWS_IP_ADDRESS]/project
  3. Your project should load and run from the Windows XAMPP server
  4. Any changes you make to files on the Mac will immediately reflect in the original Windows folder

You're all set! You can now develop seamlessly across both machines without duplicating your development environment.

Top comments (0)