I have installed Xampp 7.2.34 from https://www.apachefriends.org in Big Sur.
XAMPP htdocs folder is placed in /Applications/XAMPP/xamppfiles
directory. Is there anyway that I can change the location of htdocs folder and place all my projects in the new location.
Current Location: /Applications/XAMPP/xamppfiles/htdocs
Desired Location: /Users/user/Desktop/Work/PHP/htdocs
I am following this question in Stackoverflow but it seems quite old and I was not able to accomplish what I required.
Already done:
- Created new empty htdocs folder on desired location
- Changed
User daemon
toUser user
inxamppfiles/etc/httpd.conf
- Didn’t change
Group daemon
- Changed
DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs"
toDocumentRoot "/Users/user/Desktop/Work/PHP/htdocs"
inxamppfiles/etc/httpd.conf
- Changed
<Directory "/Applications/XAMPP/xamppfiles/htdocs">
to<Directory "/Users/user/Desktop/Work/PHP/htdocs">
inxamppfiles/etc/httpd.conf
- I also uncommented this line of code
Include etc/extra/httpd-vhosts.conf
inxamppfiles/etc/httpd.conf
Result:
Access forbidden!
error.
What did I miss? Has something changed in these years? TIA.
2
Answers
I have the same issue, but worked with this this solution. You could using Xampp in another version, Xampp 7.4.15 with this configuration
This worked for me using XAMPP 8.2.0 and macOS 12.6.2 Monterrey:
Make a copy of htdocs and put it where you want it. In my case, I made my copy in /Users/me/Dropbox/XAMPP/htdocs
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/Programming/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/Programming/XAMPP/htdocs
Save the files and restart the servers.
That was it. Hope helps someone. I looked for this answer for a long time.