ID: 30881 Updated by: [EMAIL PROTECTED] Reported By: ovdspek at liacs dot nl -Status: Open +Status: Bogus Bug Type: Scripting Engine problem Operating System: Debian Linux Sarge PHP Version: 4.3.9 New Comment:
All other SAPIs will chdir to the scripts directory. CLI will not. This is not a bug, so please don't reopen this report. You can always use: include dirname(__FILE__).'/../1.php'; to solve your problem with relative paths in includes. Previous Comments: ------------------------------------------------------------------------ [2004-11-25 23:59:46] ovdspek at liacs dot nl I'm not asking for PHP (CLI) to change the cwd to that of the script. I'm only asking for PHP to look for files *relative to the directory of the current script*, as the documentation claims it does. Note that the directory of the current script is *not* equivalent to the cwd (current working directory). > Files for including are first looked in include_path relative to the current working directory and then in include_path relative to the directory of current script. ------------------------------------------------------------------------ [2004-11-25 22:55:24] [EMAIL PROTECTED] PHP CLI "does not change the working directory to that of the script" (c) http://www.php.net/manual/en/features.commandline.php In your case documentation says about other SAPIs. ------------------------------------------------------------------------ [2004-11-24 14:45:34] ovdspek at liacs dot nl Oops, forgot to reopen. ------------------------------------------------------------------------ [2004-11-24 14:34:58] ovdspek at liacs dot nl And doesn't the documentation claim to already search relative to the script dir? > and then in include_path relative to the directory of current script. ------------------------------------------------------------------------ [2004-11-24 14:33:16] ovdspek at liacs dot nl I'm asking for an addition, not a modification. What kind of scripts would be broken if you search additional paths (after searching in the old way)? ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/30881 -- Edit this bug report at http://bugs.php.net/?id=30881&edit=1