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

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

  1. Blog
  2. 15 November 2026
  3. 4 min read

Stefan Bogdanescu

Founder & Senior Architect

MacOS XAMPP Access Forbidden Error 403: Diagnosing Permission Denials on Catalina and Beyond

If you are seeing an "Access forbidden" error (HTTP 403) while running XAMPP on macOS, particularly after upgrading to Catalina or later, the issue rarely lies in your .htaccess directives or the Require all granted line. The culprit is almost always the underlying filesystem permissions interacting with the deprecated 32-bit architecture of older XAMPP builds.

macOS 10.15 (Catalina) dropped support for 32-bit applications entirely. If your previous installation worked on Mojave but fails immediately upon rebooting into Catalina, or if you recently migrated a folder containing an old XAMPP build, the Apache daemon cannot execute because the binary itself is incompatible with the OS. However, even when you have successfully replaced the core binaries with a 64-bit compatible version of XAMPP (such as 7.4.1), the error persists if the DocumentRoot or its parent directories lack read and execute permissions for the Apache user.

The Apache User Context on macOS

When Apache starts, it does not run as your primary user account (e.g., danielschnoll). Instead, it runs under a specific system user to isolate web processes. On modern macOS versions, this is typically www or www-admin, though older configurations might rely on _apache. The critical constraint is that Apache cannot simply "guess" access; it must have explicit read and execute permissions on every directory path leading to the root document.

If you attempt to access a virtual host pointing to /Users/danielschnoll/Documents/Projects/Dunsparce.net, the server will traverse the following hierarchy:

  1. / (Root)
  2. /Users
  3. /Users/danielschnoll
  4. /Users/danielschnoll/Documents
  5. /Users/danielschnoll/Documents/Projects
  6. /Users/danielschnoll/Documents/Projects/Dunsparce.net

If any single step in this chain is restricted to drwx------ (owned by root or a different user without execute permission for others), Apache halts access and returns a 403 Forbidden error, regardless of what your <Directory> block says in the configuration.

Verifying Filesystem Permissions

To resolve this, you must ensure that the parent directories are accessible to the Apache user. Run the following command in your terminal to inspect the permissions of your project directory:

ls -ld /Users/danielschnoll/Documents/Projects/Dunsparce.net

If the output shows drwx------ or similar restrictive modes, and you are logged in as a standard user, Apache may not be able to traverse it. The safest approach for development environments on macOS is to set the permissions of your project folder and its immediate parents to allow group read/execute access.

chmod 755 /Users/danielschnoll/Documents/Projects/Dunsparce.net
chmod -R 755 /Users/danielschnoll/Documents/Projects

The 755 mode grants the owner full control (rwx) and read/execute access to group and others (r-x). This is sufficient for Apache to serve static files or execute PHP scripts without exposing write permissions unnecessarily.

Configuring VirtualHosts Correctly

Your provided configuration snippet includes <Directory> blocks with Require all granted. While syntactically correct for modern Apache 2.4+, there is a subtle pitfall regarding the Options directive. Specifically, you have included Includes execCGI and ExecCGI.

In many default XAMPP configurations on macOS, the main httpd.conf file might already define <Directory> blocks for /Applications/XAMPP/xamppfiles/htdocs that override settings from your virtual host files if not careful. However, since you are using custom paths in your VirtualHosts, the directives inside your specific .conf or .vhost files should take precedence provided the path matches exactly.

Ensure that the DocumentRoot in your <VirtualHost> block matches the path in the corresponding <Directory> block character-for-character. A mismatch here can sometimes cause Apache to fall back to default restrictive behaviors defined elsewhere in the config stack.

If you continue to face issues after correcting permissions, verify that the Apache service is actually running and listening on port 80:

sudo lsof -i :80

If you see output indicating a process bound to localhost:80, the service is active. If you see no results, restart Apache via the XAMPP Control Panel or using apachectl:

sudo apachectl graceful

Moving Forward with Modern Stacks

While fixing permissions allows your current setup to function, relying on XAMPP for production-grade PHP development is increasingly discouraged due to its monolithic nature. The stack bundles specific versions of PHP and MySQL that may not align perfectly with the latest framework requirements or security patches.

For modern Laravel applications specifically, consider transitioning to a dedicated environment using Laradock or Docker. These tools provide granular control over containerized dependencies, ensuring that your web server, PHP runtime, and database are isolated and version-managed independently of your host OS's quirks. This approach eliminates the "it worked on Mojave but not Catalina" headache entirely by running your stack in a consistent environment regardless of the underlying macOS version.

If you prefer staying with XAMPP for quick prototyping, ensure that you always reinstall the latest 64-bit build when switching to a new macOS version and meticulously check directory permissions immediately after installation.

Our network