Re: Re: best way to properly build an include path *regardless* from where I am calling the include?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Jul 5, 2009, at 6:15 PM, Shawn McKenzie wrote:

AFAIK, include '/somedir/somefile.php'; looks for that specific file in
that specific path because you gave an absolute path.

Well, that is what I wanted.
So I tried this:
include '/MY_inc_php/GovBC_php_functions.inc';
but that fails.
So I try this:
include '/home/metheuser/public_html/MY_inc_php/ GovBC_php_functions.inc';
and it works.

But if I ever have to move to a server where the "home" part of that path is not "home", or the "public_html" part of that path is not "public_html" (I dunno.. I do not run servers), then my includes break.


If you do include 'somedir/somefile.php'; then it looks in all paths in
the include path

Here ^^^ when you say "it looks in all paths in the include path", what are you talking about? It seem like you do not mean the path in my include statement itself, but in some string (path) that is built and stored somewhere else. (?)
Where do I build/store that?

and appends somedir/somefile.php.  So if your include
path contained /usr/share/php/PEAR for example and somefile.php was at
/usr/share/php/PEAR/somedir/ then it would find it.




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux