skip to Main Content

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:

  1. Created new empty htdocs folder on desired location
  2. Changed User daemon to User user in xamppfiles/etc/httpd.conf
  3. Didn’t change Group daemon
  4. Changed DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs" to DocumentRoot "/Users/user/Desktop/Work/PHP/htdocs" in xamppfiles/etc/httpd.conf
  5. Changed <Directory "/Applications/XAMPP/xamppfiles/htdocs"> to <Directory "/Users/user/Desktop/Work/PHP/htdocs"> in xamppfiles/etc/httpd.conf
  6. I also uncommented this line of code Include etc/extra/httpd-vhosts.conf in xamppfiles/etc/httpd.conf

Result:

Access forbidden! error.

enter image description here

What did I miss? Has something changed in these years? TIA.

2

Answers


  1. 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

    Login or Signup to reply.
  2. 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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search