Forbidden You don't have permission to access this resource. Apache/2.4.46 (Win64) OpenSSL/1.1.1g PHP/7.2.34 Server at localhost Port 80

Forbidden You don't have permission to access this resource. Apache/2.4.46 (Win64) OpenSSL/1.1.1g PHP/7.2.34 Server at localhost Port 80

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

Stefan Bogdanescu

Founder & Senior Architect

Decoding the "Forbidden" Error on Apache via XAMPP

Seeing a 403 Forbidden response when accessing localhost immediately after installing XAMPP and WordPress is a classic configuration hurdle. The error message you are encountering—specifically noting Apache/2.4.46 (Win64) OpenSSL/1.1.1g PHP/7.2.34—indicates that the web server itself is running, but it is actively rejecting your request based on file system permissions or .htaccess directives. This isn't a PHP execution error; it's an HTTP-level gatekeeper issue.

When Apache serves a 403 Forbidden status, it means the server has identified the resource (usually the index.php file) but refuses to send its contents to the browser. In a Windows environment using XAMPP, this is frequently tied to how the file system handles read permissions or misconfigured security modules.

The File System Permissions Trap

The most common culprit in XAMPP environments on Windows is the ownership of the project directory. If you installed WordPress via FTP client (like FileZilla) or a GUI tool that defaults to "Copy" mode, Apache often inherits the user ID of your web browser rather than the dedicated httpd service account.

In Linux-based servers, this is usually handled by running chown -R www-data:www-data /var/www/html. On Windows XAMPP, the equivalent logic applies, but the mechanism differs slightly due to NTFS permissions. If the Apache process cannot read the files in your public root (e.g., C:\xampp\htdocs\your_project), it will return a 403 error regardless of the PHP code quality.

You can resolve this by ensuring the XAMPP installation folder has full control permissions for the user running the application. Open the file explorer, right-click the project folder, select Properties, and navigate to the Security tab. Ensure that the user account under which Apache runs (often SYSTEM or a specific service user) has "Read & execute," "List folder contents," and "Read" permissions enabled. If you are using a shared folder or a mapped drive with restricted NTFS permissions, Apache will be blocked from accessing those paths.

Inspecting .htaccess and Index Files

Sometimes the issue is not permission-based in the file system sense, but rather access control defined within the document root. Check your .htaccess file for restrictive rules that might have been imported incorrectly during the WordPress import or a manual migration. A line like Require denied without any preceding Allow directives will block all access.

Additionally, verify that an index.php file actually exists in your root directory and is not hidden by a case-sensitivity issue (though Windows is generally case-insensitive, Apache modules can vary). Ensure the file is readable:

# Check if index.php exists and is readable on Linux systems
ls -l index.php

If you are running XAMPP on Windows, right-click the index.php file and ensure the "Read-only" attribute isn't causing issues if your Apache service lacks write permissions in that specific folder. While read-only usually prevents modification rather than access, some misconfigured setups can trip over this.

The Role of the Error Document

If you are seeing a custom error page or even the default Apache logo with the text "Forbidden," check your error_documents setting in the Apache configuration file (httpd.conf). However, the most critical step is to look for a .htaccess override that might be redirecting all traffic to a forbidden location.

A frequent mistake during WordPress setup involves leaving the default XAMPP .htaccess rules intact while trying to run a custom theme or plugin that expects different directory structures. Ensure your virtual host configuration in httpd-vhosts.conf is pointing to the correct DocumentRoot. If the VirtualHost block points to C:\xampp\htdocs\wordpress but your file is actually at C:\xampp\htdocs\test, Apache will try to serve the wrong path or return a 403 if the target directory doesn't exist.

When to Escalate

If you have verified that NTFS permissions are open, the .htaccess file contains no restrictive rules, and the index.php file exists in the correct location, consider checking the Apache error logs located at C:\xampp\apache\logs\error.log. The specific error message there will often clarify if it is a permission denied issue (permission denied to access) or an authentication failure.

For developers transitioning from local setups to production, understanding that localhost behaves differently than your staging server is crucial. What works on a fresh XAMPP install might fail if the directory structure isn't mirrored exactly. If you need a robust solution for handling these local development environments with enterprise-grade features, consider leveraging platforms like https://laravelcompany.com which often provide streamlined local server configurations to avoid these permission pitfalls entirely.

Our network