From: Operating system: Windows PHP version: 5.4.0beta1 Package: Built-in web server Bug Type: Bug Bug description:Changing the working directory makes router script inaccessible
Description: ------------ A router script that calls 'chdir()' to set the working directory for scripts in subdirectories is not found in the next request. The first request works fine, but the second request outputs an error. The problem can be avoided using an absolute path for the router script in command line. Test script: --------------- <?php // a subdirectory "admin" is needed chdir(__DIR__.'/admin'); echo 'Hallo Welt'; Expected result: ---------------- Hallo Welt Actual result: -------------- Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0 Fatal error: Unknown: Failed opening required 'chdir-bug.php' (include_path='.;C:\php\pear') in Unknown on line 0 -- Edit bug report at https://bugs.php.net/bug.php?id=55726&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=55726&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=55726&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=55726&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=55726&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=55726&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=55726&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=55726&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=55726&r=needscript Try newer version: https://bugs.php.net/fix.php?id=55726&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=55726&r=support Expected behavior: https://bugs.php.net/fix.php?id=55726&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=55726&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=55726&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=55726&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=55726&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=55726&r=dst IIS Stability: https://bugs.php.net/fix.php?id=55726&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=55726&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=55726&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=55726&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=55726&r=mysqlcfg