#41094 [Opn->Bgs]: filesystem functions not write to files after die()

From: Date: Mon, 16 Apr 2007 00:48:36 +0000
Subject: #41094 [Opn->Bgs]: filesystem functions not write to files after die()
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-111519@lists.php.net to get a copy of this message
ID: 41094 Updated by: scottmac@php.net Reported By: speakus at mail dot ru -Status: Open +Status: Bogus Bug Type: Filesystem function related Operating System: winXPsp2 PHP Version: 5.2.1 New Comment: When the shutdown function is called the working directory changes to what it was prior to the script running, in this case Apache uses / If you use an absolute path then it will append correctly. Previous Comments: ------------------------------------------------------------------------ [2007-04-15 23:22:49] speakus at mail dot ru code: <?php file_put_contents("debug.txt", "text", FILE_APPEND); ?> work - absolutely correcly - create/update the file but submited code - is not. I think it is not possible in simple case "other working directory" ;) ------------------------------------------------------------------------ [2007-04-15 17:44:39] johannes@php.net Please do not submit the same bug more than once. An existing bug report already describes this very problem. Even if you feel that your issue is somewhat different, the resolution is likely to be the same. Thank you for your interest in PHP. Apache changes the working directory to / so you\'re actually writing to /debug.txt. ------------------------------------------------------------------------ [2007-04-15 15:49:46] speakus at mail dot ru Description: ------------ I reproduce problem only if PHP Installed as an Apache module! No issue on php-cgi Reproduce code: --------------- <?php function Shutdown() { file_put_contents("debug.txt", "text", FILE_APPEND); } register_shutdown_function('Shutdown'); Expected result: ---------------- file "debug.txt" updated/created with text Actual result: -------------- no file created or no updated file ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=41094&edit=1

« previous php.bugs (#111519) next »