NYCPHP Meetup

NYPHP.org

[nycphp-talk] trouble with PHP5 CGI Suse 9.1 - client denied by server configuration

Jayesh Sheth jayeshsh at ceruleansky.com
Tue Dec 28 12:51:00 EST 2004


Hello all,

perhaps some of the (SuSe) Linux gurus out there will have an idea as to 
what is going on here.

I have an existing SuSe 9.1 Linux LAMP server set up with Apache 2.x, 
PHP 4.3.x, MySQL 4.x.
The thing is that I want to use PHP 5 instead of PHP 4. But I also want 
to run older PHP4 scripts.

I followed the instructions in Appendix C of Adam Trachtenberg's 
"Upgrading to PHP 5" book to use PHP 5 as a CGI, so that I can continue 
to use PHP 4 as an Apache module.
(To use PHP5 scripts, I would simply configure Apache to execute scripts 
from a particular directory using the PHP 5 CGI binary.)

I compiled PHP with the following options:

./configure --prefix=/usr/local/php5/ \
--enable-force-cgi-redirect \
--with-xml \
--with-libxml-dir=/usr/local/ \
--enable-soap \
--with-xsl=/usr/local/ \
--with-mysql \
--with-tidy-dir=/usr/ \
--with-curl-dir=/usr/local/ \
--with-mcrypt-dir=/usr/local/ \
--with-zlib-dir=/usr/local/ \
--with-gd \
--with-jpeg-dir=/usr/local/ \
--with-png-dir=/usr/local/ \
--enable-gd-native-ttf \
--enable-ftp \
--enable-sockets \
--enable-wddx \
--with-xmlrpc \
--with-iconv \
--enable-soap

Thus, the PHP binary was installed to :
/usr/local/php/bin/

I am not sure the this was right thing to do, but I chowned 
/usr/local/php/bin/ and its subdirectories to run as wwwrun user and 
belong to www group (Apache's user and group).

I then modified /etc/apache2/httpd.conf and added the following 
information to the end of it:

ScriptAlias /php5 /usr/local/php5/bin
<Directory /usr/local/php5/bin/>
    Options +ExecCGI +FollowSymLinks
    AllowOverride None
</Directory>

<Directory /srv/www/htdocs/php5>
    AddHandler php-cgi-script .php
    Action php-cgi-script /php5/php
    Options +ExecCGI
</Directory>

But when I try to access http://myipaddress/php5/
I get the following error in Apache's error logs ( 
/var/log/apache2/error-log ) :

[Tue Dec 28 12:18:33 2004] [warn] Init: Session Cache is not configured 
[hint: SSLSessionCache]
[Tue Dec 28 12:18:33 2004] [notice] suEXEC mechanism enabled (wrapper: 
/usr/sbin/suexec2)
[Tue Dec 28 12:18:34 2004] [notice] Apache/2.0.49 (Linux/SuSE) 
configured -- resuming normal operations
[Tue Dec 28 12:20:20 2004] [error] [client 69.86.**.***] client denied 
by server configuration: /usr/local/php5/bin/pinfo.php
[Tue Dec 28 12:23:18 2004] [error] [client 69.86.**.***] client denied 
by server configuration: /usr/local/php5/bin/php.cgi
[Tue Dec 28 12:25:32 2004] [error] [client 69.86.**.***] client denied 
by server configuration: /usr/local/php5/bin/php
script not found or unable to stat

You see various different things after the "client denied by server 
configuration:" part because I was renaming the php binary and also I 
added a .htaccess in another subdirectory that looked like the following:

AddHandler custom-php .php .pcgi
Action custom-php /php5/php
Options +ExecCGI

But when I access http://myipaddress/php5/pinfo.php
I get the following error:

Access forbidden!

You don't have permission to access the requested object. It is either 
read-protected or not readable by the server.

If you think this is a server error, please contact the webmaster.
Error 403

Does anyone know why this is happening?

Thanks in advance!

Best regards,

- Jay





More information about the talk mailing list