note 33801 added to function.include
| From: | danielm at NOSPAM dot bluetiger dot net | Date: | Tue, 08 Jul 2003 07:00:48 +0000 |
| Subject: | note 33801 added to function.include | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-51675@lists.php.net to get a copy of this message | ||
It appears that include files are searched for:
1) In the _current directory_ , then
2) In the same directory as the file containing the include statement.
This affects cases in which the original script includes a file in another directory, particularly
when the included file in turn contains include statements specifying filenames which exist in both
places.
All of this has more or less been stated before, except that I don't think anyone made a
distinction between the current directory and the directory the original script is in.
Experimentation shows that (at least in the Apache and CLI SAPIs), it is the current directory which
matters. In the case of a web-accessible script, this _is_ usually the directory the original
script is in. But this is not the case if a web-accessible script uses chdir() for some reason, nor
is it necessarily the case with a CLI script.
----
Manual Page -- http://www.php.net/manual/en/function.include.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+33801
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+33801&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+33801&report=yes