Forum Moderators: phranque

Message Too Old, No Replies

Alias returns a "403 Forbidden" error only with PHP files

Alias works fine with HTML files

         

guarriman

7:47 pm on Feb 22, 2008 (gmt 0)

10+ Year Member



Hi.

Using Apache2 on Linux, I get a "403 Forbidden" error only when I
access PHP files:
[domain.com...]
but it works fine with HTML files
[domain.com...]

In addition, PHP scripts work fine on root directory (outside Alias
directories):
[domain.com...] WORKS OK

I don't see any information on error logs, and I've got no idea about
how to fix this.

This is my "httpd.conf" configuration
---------
Alias /foo/ /var/www/httpdocs/modules/foo/web/
<Directory "/var/www/httpdocs/modules/foo/web/">
Options Indexes FollowSymLinks
Order Allow,Deny
Allow from all
AllowOverride all
DirectoryIndex index.php
</Directory>
---------

Any suggestion? Thank you very much,

guarriman

7:48 pm on Feb 22, 2008 (gmt 0)

10+ Year Member



If I add "ExecCGI" I get a "500 Internal Error" message, with this
line on the error logs:

[Fri Feb 22 11:27:45 2008] [error] [client 183.10.52.18] Premature end
of script headers: hello.php, referer: [domain.com...]

guarriman

8:44 pm on Feb 22, 2008 (gmt 0)

10+ Year Member



I think that this has to do with these lines inserted at the top of
the VirtualHost configuration:

--------------------------------------------
AddHandler fcgid-script .php .php5
SuexecUserGroup myuser psacln
DocumentRoot "/var/www/httpdocs/web"
ErrorLog /etc/httpd/logs/dev_error_log
<Directory "/var/www/httpdocs/web">
Options ExecCGI Indexes FollowSymLinks
AllowOverride All
Allow from all
FCGIWrapper /var/www/bin/php5 .php5
FCGIWrapper /var/www/bin/php5 .php
Order Allow,Deny
</Directory>
-----------------------------

Facts:
- I did: []# chown -R myuser /var/www
- I did: []# chgrp -R psacln /var/www
- I did: []# chmod -R 755 /var/www (so everybody can execute and read
all the files)
- 'psacln' group does exist in '/etc/group'
- 'myuser' user does exist in '/etc/passwd'
- '/var/www/bin/php5' does exist

gergoe

12:01 pm on Feb 23, 2008 (gmt 0)

10+ Year Member



Did you tried moving the FCGIWrapper directives outside of the <Directory> container?