Re: PHP Support Not Taking Issues Seriously

From: Date: Mon, 06 Feb 2006 18:22:49 +0000
Subject: Re: PHP Support Not Taking Issues Seriously
References: 1  Groups: php.qa 
Request: Send a blank email to php-qa+get-26675@lists.php.net to get a copy of this message
John CastleComm wrote:
    The example consists of files
/mainfile.php - INI sets appension to path "./ws", and includes ws/wsfile.php /ws/wsfile.php - Includes "../inc/incfile.php" /inc/incfile.php Running mainfile does not work. The script can't find "../inc/incfile.php" from the current working directory (root directory), even though the include_path should be looking from the perspective of "./ws" at least once which is equivalent to "/ws".
If I am under /ws, then of course I can see/include "../inc/incfile.php". Even the warning shows the right include path.
You simply did not read the manual and the quote from http://bugs.php.net/bug.php?id=36249 carefully enough. The important sentence is: "If filename begins with ./ or ../, it is looked only in include_path relative to the current working directory" So if you execute "mainfile.php", your current working directory (CWD) is "/(PROTECTED)/john/error". If you include "ws/wsfile.php", your CWD is still "/(PROTECTED)/john/error", not "/(PROTECTED)/john/error/ws". So if you include "../inc/incfile.php" from /ws/wsfile.php, it is only looked up in the CWD, which is "/(PROTECTED)/john/error" and not "/(PROTECTED)/john/error/ws", and "/(PROTECTED)/john/inc/incfile.php" does not exist. regards Andreas

« previous php.qa (#26675) next »