Good day,
I've been struggling with this problem for quite a while now, I've
looked on google, but to no avail, documentation doesn't help me out
either. Now, I know this isn't a pure php problem as such, but rather a
problem in the cooperation of apache2.2, php and fastcgi.
So, here's what I have
I compiled php with --enable-fastcgi
by itself, php works fine.
I've installed mod_fastcgi and apache 2.2.4, which work fine aswell
(well, apache does, mod_fastcgi is hard to tell :)).
I've got the following in my httpd.conf:
ScriptAlias /fcgi-sys/ /usr/local/apache2/fcgi-sys/
<Location /fcgi-sys/>
Options ExecCGI
SetHandler fastcgi-script
</Location>
Action application/x-httpd-php5-2-3 "/fcgi-sys/php-cgi"
AddHandler application/x-httpd-php5-2-3 .php5
So, I start up apache (apachectl -k start), it doesn't show any errors
or anything. Opening my browser and going to localhost shows the html
page I expected to see. So that works.
I've made a file phpinfo.php5 with the contents
<?php
phpinfo();
?>
Now, when I point my browser there, I recieve a 403 Forbidden error:
Forbidden
You don't have permission to access /fcgi-sys/php-cgi/phpinfo.php5 on
this server.
Thinking this is probably some permissions issue, I've temporarily
chmodded the php-cgi binary and the php script to 777. After doing that:
nothing changed, still the same error.
Ok, so I checked apache's error_log, and saw:
[Mon Jul 16 20:09:33 2007] [error] [client 192.168.2.100] client denied
by server configuration: /usr/local/apache2/fcgi-sys/php-cgi
[Mon Jul 16 20:10:36 2007] [error] [client 192.168.2.100] client denied
by server configuration: /usr/local/apache2/fcgi-sys/php-cgi
[Mon Jul 16 20:15:04 2007] [error] [client 192.168.2.100] client denied
by server configuration: /usr/local/apache2/fcgi-sys/php-cgi
ok, that's weird... Well, I decided to google this, and the few pages
that talked about this (or something close to this) all stated that it
was due to apache being closed down pretty much by default, and they
recommended easing the restrictions a bit by adding a .htaccess file in
the webroot with:
<Location />
AllowOverride None
Order Deny,Allow
Allow from all
</Location>
I did that, no help. I even added a
<Location />
Options +ExecCGI
</Location>
just in case, but that did not help either.
However, if I (from the commandline) skip apache and simply issue a:
/usr/local/apache2/fcgi-sys/php-cgi
/usr/local/apache2/htdocs/phpinfo.php5 > phpinfo.html
it will run just fine, showing the exact output I expect, and the
phpinfo.html file is visible via the browser just fine aswell.
So, I'm guessing this is an issue in apache-configuration or
fastcgi-configuration, but I'll be damned if I know what to do now...
any pointed would be welcome.
cheers,
- Tul
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php