include_path and relative vs. absolute paths

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

 



I am still getting used to .php after moving from .asp and one thing I had
trouble getting my head around was the apparent inability to use absolute
paths for include files.

If I change the include_path in php.ini to say -
include_path=".;c:\php\site1\inc" then I can access include files either
relatively
eg. require '../includes/somefile.php'; where the includes folder is at the
same level as the current folder
or absolutely
eg. require 'somefile.php'; where the file is either in the same folder or
is c:\php\site1\inc

Now the second option is fine except if I have multiple sites on the one
server.

With .asp it would just read /inc/somefile.inc either from the root of the
site or from a virtual folder but the include_path setting forces all the
sites to use the either the one include folder or at least not use the same
file names if there are multiple folders specified.

Does anyone know another way of dealing with this?

Thanks

Neil

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


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux