A guide to moving htdocs on Mac

Problems with the Mac OS X version of XAMPP, questions, comments, and anything related.

A guide to moving htdocs on Mac

Postby pizzafilms » 05. February 2023 00:32

I searched everywhere and tried tons of solutions for this question and this is what worked for me. Your mileage may vary, and if you find something wrong or missing, please post here. Frankly, this should be part of the FAQs because it's just not right to have user documents in the /Applications/XAMPP folder and not know how to move htdocs.

My example here it moving htdocs to my local Dropbox folder, /Users/me/Dropbox/XAMPP/htdocs

- Shutdown any running servers (MySQL, ProFTD, Apache)
- Copy your current htdocs to where you want it. In this example, I'm moving it to /Users/me/Dropbox/XAMPP/htdocs
- Rename your current htdocs to something like htdocs-old to make sure it works, and to keep a back up, just in case.

- Edit /Applications/XAMPP/xamppfiles/etc/httpd.conf
- Change DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs" to DocumentRoot "/Users/me/Dropbox/XAMPP/htdocs"
- Change <Directory "/Applications/XAMPP/xamppfiles/htdocs"> to <Directory "/Users/me/Dropbox/XAMPP/htdocs">
- Change User daemon to User me (your user name)

- Edit /Applications/XAMPP/xamppfiles/phpmyadmin/config.inc.php
- After $cfg['SaveDir'] = ''; add $cfg['TempDir'] = '/tmp';

- Edit /Applications/XAMPP/xamppfiles/properties.ini
- change apache_htdocs_directory=/Applications/XAMPP/xamppfiles/htdocs to apache_htdocs_directory=/Users/me/Dropbox/XAMPP/htdocs

- Save the files and restart all the servers
- Go to localhost in your browser and you should see the XAMPP dashboard. Click on PHPinfo and phpMyAdmin at the top and they should work properly.

Hopefully this helps someone. As I said, there really should be a FAQ with this info in it.
pizzafilms
 
Posts: 2
Joined: 16. January 2023 22:54
XAMPP version: 8.2.0
Operating System: Mac 12.6.2

Re: A guide to moving htdocs on Mac

Postby JDLH » 05. February 2023 01:32

> As I said, there really should be a FAQ with this info in it.

Have you found your way to the VHhosts documentation in the XAMPP dashboard? It is part of your local XAMPP installation, at a URL like http://localhost/dashboard/docs/configure-vhosts.html.

That page is generated from source at https://github.com/ApacheFriends/web/blob/main/source-xampp-osx/docs/configure-vhosts.adoc. Consider making a pull request with some improvements to that source. It should eventually filter out to the distributed version of XAMPP.
JDLH
 
Posts: 23
Joined: 11. September 2022 02:27
XAMPP version: 7.4
Operating System: macOS 12.6


Return to XAMPP for macOS

Who is online

Users browsing this forum: No registered users and 48 guests