ID: 30881 User updated by: ovdspek at liacs dot nl Reported By: ovdspek at liacs dot nl -Status: Bogus +Status: Open Bug Type: Scripting Engine problem Operating System: Debian Linux Sarge PHP Version: 4.3.9 New Comment:
Oops, forgot to reopen. Previous Comments: ------------------------------------------------------------------------ [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)? ------------------------------------------------------------------------ [2004-11-24 14:29:14] [EMAIL PROTECTED] Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php This is expected, and we can not change this as it will break a lot of scripts. ------------------------------------------------------------------------ [2004-11-24 14:25:06] ovdspek at liacs dot nl Description: ------------ In PHP, includes (appear to) use the current working directory. In C++, includes use the directory of the including script (and the include path). Could the C++ behaviour be added to PHP includes? Because if relative includes are used, current PHP scripts can only be executed if cwd == script dir. Reproduce code: --------------- $ cat 1.php <?php echo "1.php<br>\n"; ?> $ cat b/2.php <?php include('../1.php'); ?> $ php -f b/2.php Warning: main(../1.php): failed to open stream: No such file or directory in /home/olaf/t/a/b/2.php on line 2 Warning: main(): Failed opening '../1.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /home/olaf/t/a/b/2.php on line 2 $ cd b $ php -f b/2.php Could not open input file: b/2.php. $ php -f 2.php 1.php<br> $ Expected result: ---------------- Warning: main(../1.php): failed to open stream: No such file or directory in /home/olaf/t/a/b/2.php on line 2 Warning: main(): Failed opening '../1.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /home/olaf/t/a/b/2.php on line 2 Actual result: -------------- 1.php<br> ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=30881&edit=1