httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John Garvin" <>
Subject Re: [users@httpd] Really strange
Date Thu, 05 Oct 2006 21:48:34 GMT
On 10/5/06, AR <> wrote:
> Hi,
> I have this line of code in PHP:
> include_once('../');
> I'm 100% sure that the file is a directory up.
> is in /var/www/html
> and the file that calls it is in
> /var/www/html/classes
> nevertheless, i'm getting the error:
> "Warning: main(../ failed to open stream: No such file or
> directory in /var/www/html/classes/dBInsert.php on line 10

>From :
"Files for including are first looked in include_path relative to the
current working directory and then in include_path relative to the
directory of current script. E.g. if your include_path is ., current
working directory is /www/, you included include/a.php and there is
include "b.php"  in that file, b.php is first looked in /www/  and
then in /www/include/. If filename begins with ./ or ../, it is looked
only in include_path relative to the current working directory."

So... *boggle* php's inlude_path is a list of directories that will be
searched *relative* to the current directory IF you include a file
beginning with ./ or ../ . If you include('filename') then it uses the
elements of include_path as absolute paths.

wow. That seems intuitive.

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message