phpmacosapachexamppvirtualhost

MacOS XAMPP Access Forbidden Error 403 - You don't have permission to access the requested directory


I have some PHP web apps running off XAMPP 7.4.1 on macOS 10.15. XAMPP has worked for me in the past. I got my dev environment screwed up because 32 bit apps sh*t the bed with Catalina, and my old XAMPP installation didn't open. I got my VirtualHosts set back up, but now when I try to access one of my sites I get the following error.

Access forbidden!
You don't have permission to access the requested directory. There is 
either no index document or the directory is read-protected.

If you think this is a server error, please contact the webmaster.

Error 403

My virtual hosts look like the following:

# localhost
<VirtualHost *:80>
    ServerName localhost
    DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs"
    <Directory "/Applications/XAMPP/xamppfiles/htdocs">
        Options Indexes FollowSymLinks Includes execCGI
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

#####################
# PERSONAL PROJECTS #
#####################

# Dunsparce.net
<VirtualHost *:80>
    ServerName dunsparce.net
    DocumentRoot "/Users/danielschnoll/Documents/Projects/Dunsparce.net"
    <Directory "/Users/danielschnoll/Documents/Projects/Dunsparce.net">
        Options Indexes FollowSymLinks Includes ExecCGI
        AllowOverride All
        Require all granted
    </Directory>
    ErrorLog "logs/dunsparce-error_log"
</VirtualHost>

I have more VirtualHosts listed and they all follow the same format. I have Require all granted on each one, as well as the Allow Override All and the Options... line. Like I said at the start of the post, they all worked in the past. I also have the # Include uncommented in my httpd.conf file, though I'm pretty sure Access Forbidden error is completely unrelated to it.

Any ideas?


Solution

  • I wound up having to edit httpd.conf again. There’s a section for User group permissions. By default it says

    User daemon
    Group daemon
    

    Change the User from daemon to your macOS Username. For me, my User group now looks like

    User danielschnoll
    Group daemon