note 33801 deleted from function.include by sniper
| From: | sniper@php.net | Date: | Tue, 04 Nov 2003 00:42:28 +0000 |
| Subject: | note 33801 deleted from function.include by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-59793@lists.php.net to get a copy of this message | ||
Note Submitter: danielm@NOSPAM.bluetiger.net
----
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.