From: Operating system: Windows XP SP3 PHP version: 5.3.5 Package: *Directory/Filesystem functions Bug Type: Bug Bug description:Nested includes not resolved
Description: ------------ I have the following structure: common/a.php parent/b.php parent/child/c.php Now, in c.php, I included the file b.php from the "parent" folder using relative path. b.php includes a.php from "common" folder using also relative path. When I call c.php, it fails to include common/a.php within parent/b.php However, when I call b.php it includes common/a.php with no problem. And just to be clear, I have code in b.php (the actual one) that I need to keep separate from both a.php and c.php.. I have two physically different servers: Development: - Windows XP SP3 - Zend Server Community Edition 5.0.2 (Running PHP 5.3.2) Production: - Windows 2000 Small Business Server - Apache 2.2 - PHP 5.3.5 (As Apache module) Test script: --------------- [a.php] <?php echo 'I am in!'; [b.php] <?php require_once '../common/a.php'; [c.php] <?php require_once '../b.php'; Expected result: ---------------- When c.php is executed, the inclusion of common/a.php and the output of: "I am in!" Actual result: -------------- Production Server: Warning: require_once(../common/a.php): failed to open stream: No such file or directory in D:\Program Files\Apache Software Foundation\Apache2.2\htdocs\test\parent\b.php on line 3 Fatal error: require_once(): Failed opening required '../common/a.php' (include_path='.;C:\php\pear') in D:\Program Files\Apache Software Foundation\Apache2.2\htdocs\test\parent\b.php on line 3 Development Server: Warning: require_once(../common/a.php) [function.require-once]: failed to open stream: No such file or directory in C:\Program Files\Zend\Apache2\htdocs\test\parent\b.php on line 2 Fatal error: require_once() [function.require]: Failed opening required '../common/a.php' (include_path='.;C:\Program Files\Zend\ZendServer\share\ZendFramework\library') in C:\Program Files\Zend\Apache2\htdocs\test\parent\b.php on line 2 -- Edit bug report at http://bugs.php.net/bug.php?id=53849&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=53849&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=53849&r=trysnapshot53 Try a snapshot (trunk): http://bugs.php.net/fix.php?id=53849&r=trysnapshottrunk Fixed in SVN: http://bugs.php.net/fix.php?id=53849&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=53849&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=53849&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=53849&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=53849&r=needscript Try newer version: http://bugs.php.net/fix.php?id=53849&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=53849&r=support Expected behavior: http://bugs.php.net/fix.php?id=53849&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=53849&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=53849&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=53849&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=53849&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=53849&r=dst IIS Stability: http://bugs.php.net/fix.php?id=53849&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=53849&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=53849&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=53849&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=53849&r=mysqlcfg