#35816 [Opn]: file_put_contents() in __destructor-calls writes to SERVER_ROOT

From: Date: Tue, 27 Dec 2005 08:48:17 +0000
Subject: #35816 [Opn]: file_put_contents() in __destructor-calls writes to SERVER_ROOT
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-91098@lists.php.net to get a copy of this message
 ID:               35816
 User updated by:  alexander at alexautonet dot nl
 Reported By:      alexander at alexautonet dot nl
 Status:           Open
 Bug Type:         Filesystem function related
 Operating System: Windows XP SP2
 PHP Version:      5.1.1
 New Comment:

I tested also with flag 'FILE_USE_INCLUDE_PATH' but that doesn't work;
it writes also in SERVER_ROOT.


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

[2005-12-27 09:39:35] alexander at alexautonet dot nl

Description:
------------
The file_put_contents()-function writes to SERVER_ROOT; not to the same
path the script is running in. I'll use this for debug-mode (to write
SQL-query-logs and other variables to txtfiles).'
I'm using PHP 5.1.1 as loaded module in Apache 2.0.55 on Win32.

Reproduce code:
---------------
<?php
class test
{
	function __destruct()
	{
		//	Writes to SERVER_ROOT (!!)
		file_put_contents("testing.txt","Blabla");
	}
}

$x = new test();
?>

Expected result:
----------------
testing.txt has to be written in the executed path.

Actual result:
--------------
testing.txt is written in SERVER_ROOT of Apache2.


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


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


Thread (3 messages)

« previous php.bugs (#91098) next »