From: tayloj1 at uk dot ibm dot com Operating system: PHP version: Irrelevant PHP Bug Type: Documentation problem Bug description: include_path ignored if file starts with ./ or ../
Description: ------------ ref: http://uk.php.net/include/ If the file for including starts with ./ or ../, include_path is not taken into account. The statement: "If filename begins with ./ or ../, it is looked only in include_path relative to the current working directory. " should be replaced with: "If the filename begins with ./ or ../, it is only looked for relatively to the current working directory." as demonstrated by the following experiment (tested on Windows and php 5.2.2): Reproduce code: --------------- Directory layout: \myScriptDir \a.php <?php include './b.php' ?> \myWorkingDir \php.exe \php.ini [...] include_path='include1;include2' [...] Execute: \myWorkingDir> php \myScriptDir\a.php Expected result: ---------------- Doc says: "it is looked only in include_path relative to the current working directory" Expected attempted file reads (if the documentation were correct): \myWorkingDir\include1\b.php \myWorkingDir\include2\b.php Actual result: -------------- Actual attempted file reads: \myWorkingDir\b.php Result obtained by stepping through the code with a debugger (namely _php_stream_fopen_with_path() in plain_wrapper.c) and confirmed with processmonitor, a tool which can monitor filesystem activity (http://www.microsoft.com/technet/sysinternals/utilities/processmonitor.mspx) So files were only looked for relatively to the current working directory and the include path was not taken into account. -- Edit bug report at http://bugs.php.net/?id=41486&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=41486&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=41486&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=41486&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=41486&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=41486&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=41486&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=41486&r=needscript Try newer version: http://bugs.php.net/fix.php?id=41486&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=41486&r=support Expected behavior: http://bugs.php.net/fix.php?id=41486&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=41486&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=41486&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=41486&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=41486&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=41486&r=dst IIS Stability: http://bugs.php.net/fix.php?id=41486&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=41486&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=41486&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=41486&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=41486&r=mysqlcfg
