Problem with PHP include on CentOS 4.2

Support for webhosts that use CentOS
Post Reply
KMorley
Posts: 28
Joined: 2006/10/20 16:59:51
Location: Tampa, Florida

Problem with PHP include on CentOS 4.2

Post by KMorley » 2007/04/09 17:56:09

I'm running CentOS 4.2 (Server CD). The Apache version is 2.0.52-28 and PHP is 4.3.9-3.22.3.

This seems to be a PHP issue with a particular script. The problem lines in the script are:

include (dirname(__FILE__)."/phpagi/misc.php");
include (dirname(__FILE__)."/phpagi/phpagi-asmanager.php");

When these are executed, they yield the following errors in /var/log/httpd/error_log:

[client 192.168.168.41] PHP Warning: main(/var/www/html/phpagi/misc.php): failed to open stream: Permission denied in /var/www/html/cfwd.php on line 12
[client 192.168.168.41] PHP Warning: main(): Failed opening '/var/www/html/phpagi/misc.php' for inclusion (include_path='.:/usr/share/pear') in /var/www/html/cfwd.php on line 12
[client 192.168.168.41] PHP Warning: main(/var/www/html/phpagi/phpagi-asmanager.php): failed to open stream: Permission denied in /var/www/html/cfwd.php on line 13
[client 192.168.168.41] PHP Warning: main(): Failed opening '/var/www/html/phpagi/phpagi-asmanager.php' for inclusion (include_path='.:/usr/share/pear') in /var/www/html/cfwd.php on line 13

The files that I'm trying to include do exist in /var/www/html/phpagi and are chmod 755. I've tried changing the file ownership, etc. without any success.

Any ideas?

Thanks!

Ken

KMorley
Posts: 28
Joined: 2006/10/20 16:59:51
Location: Tampa, Florida

Additional info

Post by KMorley » 2007/04/09 19:26:52

The problem appears to be with the phpagi subdirectory. The error is a little misleading: it's not that the file isn't found, it's just that httpd refuses to serve it up.

If I moved the scripts and include files into /var/www/html it all works well. Is there a configuration file or something that tells httpd which directories it can serve from, etc.?

Thanks!

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Problem with PHP include on CentOS 4.2

Post by gerald_clark » 2007/04/10 13:39:54

Yes.
/etc/httpd/conf/httpd.conf
Read it. It is full of documentation.

Post Reply

Return to “CentOS 4 - Webhosting Support”