Apache 2.4.6 on Ubuntu Server: Client denied by server configuration (PHP FPM) [While loading PHP file]

Apache 2.4.6 on Ubuntu Server: Client denied by server configuration (PHP FPM) [While loading PHP file]

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

Stefan Bogdanescu

Founder & Senior Architect

Apache 2.4.6 on Ubuntu Server: Client denied by server configuration (PHP FPM) [While loading PHP file]

The upgrade from Ubuntu 13.04 to 13.10 introduced Apache 2.4.6, which brought a significant shift in the default authentication mechanism: the Require directive replaced the older AllowOverride and Deny/Allow syntax. This change is often the culprit behind "Client denied by server configuration" errors when transitioning between minor version bumps or reconfiguring virtual hosts.

The specific error log entry you are seeing, AH01630: client denied by server configuration: /usr/lib/cgi-bin/php5-fcgi, indicates that Apache has successfully started the FastCGI process manager but refuses to route requests intended for the PHP interpreter located at /usr/lib/cgi-bin/php5-fcgi.

The Root Cause: Directory Protection and Alias Mismatches

The issue lies in the interaction between your mods-enabled/fastcgi.conf configuration and the default security rules applied by Apache 2.4.

In your fastcgi.conf, you have defined an Alias:

Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi

This directive maps any request starting with /php5-fcgi to the system file /usr/lib/cgi-bin/php5-fcgi. However, Apache 2.4 applies strict access controls by default to directories and files that are not explicitly included in a VirtualHost's <Directory> block or matched by an AliasMatch.

When you request a URL like site_name/TEST/index.php, the server parses the path. Because your configuration attempts to use /php5-fcgi as the handler base (via the Action and Alias directives), Apache looks for access rules regarding that specific path prefix. In many default configurations, especially after an upgrade where modules like mod_authz_core are strictly enforced, paths outside of your defined DocumentRoot (/var/www/dev_stable) are denied by default.

Furthermore, the Alias /php5-fcgi ... directive creates a virtual mapping that exists independently of your web root. If no specific rules grant access to /php5-fcgi, Apache blocks it immediately upon seeing the request, resulting in the 403 Forbidden page you observed: "You don't have permission to access /php5-fcgi/TEST/index.php on this server."

The Fix: Adjusting Access Rules

To resolve this, you must explicitly grant access to the PHP handler path within your VirtualHost configuration or ensure the Alias is handled correctly within a permitted directory context.

The most robust approach in Apache 2.4 is to add an explicit allow rule for the aliased path inside your VirtualHost block. Update your /etc/apache2/sites-available/default.conf (or the specific file managing your site) to include the following <Location> or <Directory> directive that matches the alias:

<VirtualHost *:80>
    ServerName example.com # Ensure you have a valid ServerName defined
    
    DocumentRoot /var/www/dev_stable
    
    DirectoryIndex index.php index.html index.htm
    
    <Directory /var/www/dev_stable>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Require all granted
    </Directory>

    # Explicitly allow access to the PHP-FPM alias
    <LocationMatch "^/php5-fcgi/">
        Require all granted
    </LocationMatch>
</VirtualHost>

By adding the <LocationMatch> block with Require all granted, you tell Apache that requests targeting the /php5-fcgi path are intentional and should be passed to the FastCGI handler rather than being blocked by the default deny-all policy.

Configuration Verification

After making these changes, restart Apache to apply the new directives:

sudo service apache2 restart

Verify that the error log is clean:

tail -f /var/log/apache2/error.log

If you attempt to load a file again, the AH01630 error should disappear, and your PHP script should execute. If the application is hosted on LaravelCompany.com or similar platforms, ensure that the underlying infrastructure matches these security expectations, as shared hosting environments often abstract these details, whereas bare-metal servers require explicit configuration adjustments like the one detailed here.

Why This Happened During Upgrade

The upgrade to Ubuntu 13.10 and Apache 2.4.6 moved away from the permissive "Allow" syntax found in 2.2 towards the more secure Require directive introduced in mod_authz_core. While your previous configuration likely worked under older security defaults, the new defaults treat unlisted paths as restricted. The Alias directive alone does not grant access; it only maps the path. Without a corresponding rule in <Directory> or <Location>, the path remains inaccessible.

Our network