#38820 [Fbk->Opn]: chdir(".") and chdir("..") don't work with Apache 2.0+
ID: 38820
User updated by: ras at fyn dot dk
Reported By: ras at fyn dot dk
-Status: Feedback
+Status: Open
Bug Type: Directory function related
Operating System: Win XP SP2
PHP Version: 5.1.6
New Comment:
Tony, as said - I already tried the current snapshot, downloaded the
latest development release yesterday.
Unless it was fixed and updated today, I'm sorry, but I don't have time
to uninstall, reinstall and reconfigure Apache and PHP again just now.
My current Apache 1.3 installation works just fine for me - I only use
the Windows release for testing and development on my workstation...
Previous Comments:
------------------------------------------------------------------------
[2006-09-14 08:50:01] tony2001@php.net
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
------------------------------------------------------------------------
[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
Thread (8 messages)