From:             toby at simmonsconsulting dot com
Operating system: Windows 2003 Server
PHP version:      5.2.5
PHP Bug Type:     Directory function related
Bug description:  PHP ISAPI random working dir only in Root of website

Description:
------------
PHP ISAPI under IIS 6.x (Windows 2003 Server) reports an inconsistent
working directory ONLY in the root of a web site. The working directory is
perfectly consistent when checked in a subdirectory of a web site.

I have seen similar bugs reported but they were either BOGUS or no longer
open. I understand ISAPI is unstable (according to Bug #42460) but this bug
only seems to occur in the root of a web site.

Say the root of your web site is D:\websites\testsite.

If you create a php file with the following code:

<?php
  echo getcwd()."<br />\n";
?>

and place it in the above directory then load it
(http://testsite/cwd.php), loading will produce a random directory. If you
place this file in a subdirectory, say D:\websites\testsite\testdir, and
load the page (from the new location, http://testsite/testdir/cwd.php) it
will produce the expected results: D:\websites\testsite\testdir.

Reproduce code:
---------------
<?php
  echo getcwd()."<br />\n";
?>


Expected result:
----------------
In the root folder of your website (say, D:\websites\testsite) you would
expect D:\websites\testsite.

In a subdirectory of your website (say, D:\websites\testsite\testdir) you
would expect just that, D:\websites\testsite\testdir.

Actual result:
--------------
In the root folder of your website (say, D:\websites\testsite) you get
random results, anything from C:\WINDOWS\System32 to various subdirectories
in your website (or other websites if you host more than one.)

In a subdirectory of your website (say, D:\websites\testsite\testdir) it
seems to work fine.

-- 
Edit bug report at http://bugs.php.net/?id=44777&edit=1
-- 
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=44777&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=44777&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=44777&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=44777&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=44777&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=44777&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=44777&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=44777&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=44777&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=44777&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=44777&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=44777&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=44777&r=globals
PHP 4 support discontinued:   http://bugs.php.net/fix.php?id=44777&r=php4
Daylight Savings:             http://bugs.php.net/fix.php?id=44777&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=44777&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=44777&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=44777&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=44777&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=44777&r=mysqlcfg

Reply via email to