ID: 38820 Updated by: [EMAIL PROTECTED] Reported By: ras at fyn dot dk -Status: Open +Status: Feedback Bug Type: Directory function related Operating System: Win XP SP2 PHP Version: 5.1.6 New Comment:
Please try using this CVS snapshot: http://snaps.php.net/php5.2-latest.tar.gz For Windows: http://snaps.php.net/win32/php5.2-win32-latest.zip Previous Comments: ------------------------------------------------------------------------ [2006-09-14 06:40:02] ras at fyn dot dk Description: ------------ When using chdir() with relative folders (e.g. "." and ".."), under Apache 2.0 or newer, using either the php5 module or the CGI binary, the function changes the current directory to the Apache application folder, rather than a folder relative to the current folder. Tested with PHP 5.1.6, and current 5.2.x-dev, under Apache 2.2.3, 2.0.59 and 2.0.55 - all tested with both the php5 module and the CGI binary, all with same result. Bug appears to be specific to the Windows port of PHP. Apache 1.3.37 exhibits no similar problems. I filed this bug with Apache, but Ruediger Pluem at apache.org says that "this is clearly a PHP bug": http://issues.apache.org/bugzilla/show_bug.cgi?id=40496 Reproduce code: --------------- // create the "test" folder before running the script! echo getcwd() . "<br />"; chdir("test"); echo getcwd() . "<br />"; chdir(".."); echo getcwd() . "<br />"; chdir(".."); echo getcwd(); Expected result: ---------------- C:\Web C:\Web\test C:\Web C:\ Actual result: -------------- C:\Web C:\Web\test C:\Programmer\Apache Group C:\Programmer\Apache Group ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=38820&edit=1