I'm trying to configure php and mod_spdy on Apache 2.4, Debian jessie, x64. I've followed this guide and configured Apache following this other guide and installed these packages:
libapache2-mod-fcgid
php-cgi
php5-fpm
I now have problems with php applications: when I try to open them I get a 403 Forbidden. Here is my /etc/apache2/conf-enabled/fcgid.conf
<Location />
AddHandler fcgid-script .php
Options +ExecCGI
FcgidWrapper /usr/bin/php-cgi .php
</Location>
And the error I get in /var/log/apache2/error.log
AH01630: client denied by server configuration: /usr/lib/cgi-bin/php5
I've tried adding
Order allow,deny
Allow from all
to the in the PHP application VirtualHost, but the result is just the same. Why am I getting the 403?
The 403 error message is misleading, but correct. Looking at /etc/apache2/conf-enabled/serve-cgi-bin.conf I have:
Following the code flow, the "Require all granted" on /usr/lib/cgi-bin gets executed only if mod_cgi and/or mod_cgid are enabled. In my case they were both disabled (because they are disabled by default in Debian).
solved the problem.
The 403 is often because of a missing ScriptAlias line. eg, if the Location is "/" and root for the server is /var/my-www/, put it immediately before the directive: