ID:               43977
 Updated by:       [EMAIL PROTECTED]
 Reported By:      sysdev at gmx dot net
-Status:           Open
+Status:           Feedback
 Bug Type:         Directory function related
 Operating System: Windows Server 2003
 PHP Version:      5.2.5
 New Comment:

Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows (zip):
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip

For Windows (installer):

  http://snaps.php.net/win32/php5.2-win32-installer-latest.msi




Previous Comments:
------------------------------------------------------------------------

[2008-01-29 21:49:37] sysdev at gmx dot net

Description:
------------
IIS 6 with PHP 5 SAPI:

In some cases, the CWD of a PHP-script run is not properly reset to the
script's directory. Its instead the directory of another previously run
script.

chdir() with an absulote path fails in these cases if the desired path
is no child of the script's path itself, while chdir() with a relative
path to the same destination succeedes.

Reproduce code:
---------------
Script located in d:\webshare\web3

echo '<div>CWD is '.getcwd().'</div>';
chdir( 'd:\\webshare\\web3' );
echo '<div>CWD is '.getcwd().'</div>';
chdir( 'd:\\webshare\\web3\\test' );
echo '<div>CWD is '.getcwd().'</div>';

Expected result:
----------------
Script located in d:\webshare\web3

CWD is 'd:\webshare\web3'
CWD is 'd:\webshare\web3'
CWD is 'd:\webshare\web3\test'

Actual result:
--------------
Script located in d:\webshare\web3

CWD is 'd:\webshare\another\scripts\path'
Warning: chdir() [function.chdir]: No such file or directory (errno 2)
in D:\webshare\web3\test.php on line 4
CWD is 'd:\webshare\another\scripts\path'
CWD is 'd:\webshare\web3\test'

-- or sometimes --

Script located in d:\webshare\web3

CWD is 'd:\webshare\another\scripts\path'
Warning: chdir() [function.chdir]: No error (errno 0) in
D:\webshare\web3\test.php on line 4
CWD is 'd:\webshare\another\scripts\path'
CWD is 'd:\webshare\web3\test'




------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=43977&edit=1

Reply via email to