Re: Problem with include PHP 4.3.0 (Fixed)

From: Date: Fri, 07 Feb 2003 09:01:02 +0000
Subject: Re: Problem with include PHP 4.3.0 (Fixed)
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-134707@lists.php.net to get a copy of this message
I wrote :
I have problems with relative paths and 4.3.0. Include() do not seem to work the same way in 4.3.0 and 4.2.1.
This is mostly due to a characteristic of Solaris and a minor change in the way PHP handles includes (I guess): 1) Before parsing a script, PHP sets the directory of this script as the working dir. In pathnames and include_paths, '.' represents this directory, and '..' its parent, but PHP needs to getcwd in order to use them. On Solaris, getcwd() needs "r" access to _all_ directories of the path, otherwise you get (from man getcwd):
      EACCES    A parent directory cannot be read to get its name.
It's not a bug, but a feature (seems strange to me). 2) If PHP can't find an included file in any directory of "include_path", it tries the directory of the main script in 4.2.1, and that of the including file in 4.3.0 (I guess that from my tests). On my server, a directory of the script path was not readable by the user the server runs under. I fixed it, and now PHP is able to include the requested file by way of '..' in include_path.

« previous php.general (#134707) next »