include_path and relative vs. absolute paths

From: Date: Tue, 17 Aug 2004 01:07:30 +0000
Subject: include_path and relative vs. absolute paths
Groups: php.windows 
Request: Send a blank email to php-windows+get-24419@lists.php.net to get a copy of this message
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

« previous php.windows (#24419) next »