#24420 [Com]: getcwd() returns random results in a callback
| From: | moo dot tinys at gmail dot com | Date: | Wed, 31 Dec 2008 04:59:08 +0000 |
| Subject: | #24420 [Com]: getcwd() returns random results in a callback | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-132440@lists.php.net to get a copy of this message | ||
ID: 24420
Comment by: moo dot tinys at gmail dot com
Reported By: S dot Bennett at lancaster dot ac dot uk
Status: No Feedback
Bug Type: Directory function related
Operating System: Linux
PHP Version: 4.3.3RC5-dev
New Comment:
btw, it's not random, and there's no other php requests to the server.
i can reproduce it consistently
everytime a *.php got requested, getcwd "was" the old one and php gonna
chdir() to the dirname(__FILE__) before the file is executed, but chdir
to document root failed due to some reason i dunno. so getcwd() returns
the value from previous request (in the same thread?)
i cannot trace it with filemon.exe because in php threadsafe version
it's a "Virtual Directory Support". directory permission is not a
problem
Previous Comments:
------------------------------------------------------------------------
[2008-12-31 04:50:48] moo dot tinys at gmail dot com
reproduced in 5.2.8 and 5.2.6, iis 6, windows, official build
# PHP 5.2.8 installer [17,662Kb] - 08 December 2008
md5: 159def484800411060a9eacccafd2253
reproduced with *.php in document_root but not in sub directories
file: C:\web\example.com\phpinfo.php
<?php
echo (dirname(__FILE__));
chdir(dirname(__FILE__));
chdir($_SERVER['DOCUMENT_ROOT']);
echo getcwd();
phpinfo();
?>
C:\web\example.com
Warning: chdir() [function.chdir]: No error (errno 0) in
C:\web\example.com\phpinfo.php on line 3
Warning: chdir() [function.chdir]: No error (errno 0) in
C:\web\example.com\phpinfo.php on line 4
C:\web\example.com\a
chdir() failed and getcwd() is the cwd of last success php request
which was C:\web\example.com\a\phpinfo.php
------------------------------------------------------------------------
[2003-08-26 00:58:13] sniper@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
------------------------------------------------------------------------
[2003-08-20 17:28:42] sniper@php.net
Please check your systems, there is something in common to them how you
configure/compile/etc.
------------------------------------------------------------------------
[2003-08-20 17:27:21] sniper@php.net
And the expected return value is '/' when run under Apache.
(It's apache thing..)
Nothing was verified here, just was proved that this is one of those
ghost bugs..
------------------------------------------------------------------------
[2003-08-20 11:08:11] elmicha@php.net
I also see "(in callback) cwd is '/'" (no random values) on Solaris
with PHP-4.2.1/Apache-1.3.26, so this doesn't seem to be a recent
regression.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/24420
--
Edit this bug report at http://bugs.php.net/?id=24420&edit=1