#34206 [Opn->Csd]: cwd set to server root (?) in __destruct

From: Date: Mon, 20 Aug 2007 13:38:59 +0000
Subject: #34206 [Opn->Csd]: cwd set to server root (?) in __destruct
References: 1  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969377777@lists.php.net to get a copy of this message
ID: 34206 Updated by: vrana@php.net Reported By: maniac_warlord at web dot de -Status: Open +Status: Closed Bug Type: Documentation problem Operating System: Irrelevant PHP Version: Irrelevant New Comment: This bug has been fixed in the documentation's XML sources. Since the online and downloadable versions of the documentation need some time to get updated, we would like to ask you to be a bit patient. Thank you for the report, and for helping us make our documentation better. "The working directory in the script shutdown phase can be different with some SAPIs (e.g. Apache)." Previous Comments: ------------------------------------------------------------------------ [2007-07-30 09:56:05] hans dot duedal at gmail dot com I believe this is what's causing bug:29167, as well. ------------------------------------------------------------------------ [2005-08-26 11:09:46] sniper@php.net This really should be documented. Apache(1&2) does the weird cwd change for some reason. ------------------------------------------------------------------------ [2005-08-21 19:11:26] maniac_warlord at web dot de Description: ------------ cwd is set to server root (i guess) instead of called php file's directory in __destruct() it probably isn't server root (see results), because that would be /www on linux - on windows it is Reproduce code: --------------- <?php class Foo { public function bar() { echo getcwd() . "\n"; } public function __destruct() { $this->bar(); } } $f = new Foo(); $f->bar(); ?> Expected result: ---------------- Windows XP: F:\htdocs F:\htdocs My webhoster's linux: /www/htdocs/[some number] /www/htdocs/[some number] (or whatever directory the file is in) Actual result: -------------- Windows XP: F:\htdocs D:\Apache\Apache 2 My webhoster's linux: /www/htdocs/[some number] / ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=34206&edit=1

« previous php.doc (#969377777) next »