Click to See Complete Forum and Search --> : Cannot include files!


kommissar
03-20-2005, 08:20 PM
Hi all. I am trying to include some files that are in a folder called /var/hlstats (this is outside of my webroot). I'm using php 4.3.10 and the directory with the files in it has permissions drwxr-xr-x (browsable by all) and the files in the directory are all -rw-r--r-- (readable by all) however PHP returns this error in my webserver (Apache) log.

[client 192.168.2.50] PHP Warning: main(/var/hlstats/hlstatsinc/db.inc): failed to open stream: Permission denied in /var/www/htmlkraidcss/hlstats.php on line 149
[client 192.168.2.50] PHP Fatal error: main(): Failed opening required '/var/hlstats/hlstatsinc/db.inc' (include_path='/var/hlstats') in /var/www/htmlkraidcss/hlstats.php on line 149


If the permissions are correct on the files why won't php include them?

id10t
03-21-2005, 01:13 AM
Maybe your include path?

kommissar
03-21-2005, 04:52 PM
Originally posted by id10t
Maybe your include path?
That was a typo in the main post. I actually had the right path in PHP but typed it out wrong in this post. I fixed it now.

The problem still exists.

DJMaytag
03-24-2005, 01:32 AM
Originally posted by kommissar
Hi all. I am trying to include some files that are in a folder called /var/hlstats (this is outside of my webroot). I'm using php 4.3.10 and the directory with the files in it has permissions drwxr-xr-x (browsable by all) and the files in the directory are all -rw-r--r-- (readable by all) however PHP returns this error in my webserver (Apache) log.

[client 192.168.2.50] PHP Warning: main(/var/hlstats/hlstatsinc/db.inc): failed to open stream: Permission denied in /var/www/htmlkraidcss/hlstats.php on line 149
[client 192.168.2.50] PHP Fatal error: main(): Failed opening required '/var/hlstats/hlstatsinc/db.inc' (include_path='/var/hlstats') in /var/www/htmlkraidcss/hlstats.php on line 149


If the permissions are correct on the files why won't php include them?

I don't know if this is the same thing, but this code USED to work until my ISP made some changes to their servers at the beginning of this month. It's a simple include to grab common text files that build my website, so I can change various elements of a large number of pages by changing one text file.

Anywaay, this is the error I'm getting:

Warning: main(): URL file-access is disabled in the server configuration in /home/djmaytag/index.php on line 2


Warning: main(http://www.djmaytag.com/PARTS/top.txt): failed to open stream: no suitable wrapper could be found in /home/djmaytag/index.php on line 2

This is the code (for the error listed above, on line 2 anyway):

<?php
include 'http://www.djmaytag.com/PARTS/top.txt';
?>


Any ideas as to why this would suddenylstop working when it had been working fine for about a year???