'XAMPP (macOS) - No folder access despite user permission

I want to use a custom folder for my apache web server in XAMPP and set it in the httpd.conf-file

DocumentRoot "/path/to/directory"
  <Directory "/path/to/directory">

I also ensured that the user permission was set for XAMPP to access my custom folder

# OLD ENTRY: User daemon
User Ljonja

But I still get the error 403 on localhost (access forbidden). How do I solve this? I even reinstalled it and did many times of restarting the webserver, or clearing browser cache or trying other browsers ...

Technical Infos:

  • Device: MacBook Air M1
  • System: macOS Monterney 12.2.1 (21D62)
  • XAMPP-version: XAMPP 8.1.2-0


Solution 1:[1]

I set up the Apache server via brew ( https://tecadmin.net/install-apache-macos-homebrew/ ), big thanks to @AndreC23 for quickly mentioning this idea at the end of your post.

NB: if you are using MacOS i suggest you to install Apache and MariaDB as modules using brew. See: Install & configure apache brew

In the linked tutorial, both User and Group had to be changed in the httpd.conf:

User ljonja
Group staff

Maybe this is also working out at XAMPP, but will be using the brew-variant.

Solution 2:[2]

Maybe is not an owning problem but a permission problem.

Try first with: sudo chown -R <user>:<group> ./folder_path Then: sudo chmod -R 777 ./folder_path

This should solve most permission problems.

NB: if you are using MacOS i suggest you to install Apache and MariaDB as modules using brew. See: Install & configure apache brew See: Install & configure mariaDB brew

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Ljonja
Solution 2 AndreC23