Re: include path confusion
| From: | Jeff Warrington | Date: | Thu, 11 Jan 2001 01:56:27 +0000 |
| Subject: | Re: include path confusion | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-33866@lists.php.net to get a copy of this message | ||
In article <182274521494.20010108130145@minutemanups.com>, "Randy"
<foxpro@minutemanups.com> wrote:
I would be willing to bet that within the php.ini file, an entry such
as you listed would look for includes in:
if foo = location of php.ini e.g. /usr/local/lib/php.ini,
then ../include relative to foo is /usr/local/include/
so then include files would look inside /usr/local/include.
From within your script, include "../test/sample.php" would
look relative to the path setup in php.ini,
so if include dir via php.ini is /usr/local/include/
then include from your script would be /usr/local/test/sample.php/
Anyone care to verify?
Jeff
> I'm confused on what should be a simple issue - where does php look for
> an include file in the following example? My test results seem very
> confusing and the docs never mention it.
>
> In the program:
> include "../test/sample.php";
>
> In php.ini:
> include_path="../include"
>
> Does php:
> A. Look in the dir "../test" for sample.php first and if not found,
> look in "../include" for sample.php? B. Ignore the dir "../test/" and
> look in
> "../include" for sample.php? C. Look in dir "../test" for sample.php
> and
> if not found, look in "../include" for "../test/sample.php"? (and
> can't find it as invalid) D. Look only in dir "../include" for
> "../test/sample.php"? (and can't find it as invalid)
>
> Does it work exactly the same for REQUIRE?
>
> TIA
>
>