|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
  [2001-11-27 12:04 UTC] se at e-kazan dot ru
 Current directory in main program body and into shutdown function is not same. Sometimes its changes to '/' or something else.
Try to execute this script and reload page some times:
<?
	set_time_limit(0);
	ignore_user_abort(0);
	function Test()
	{
		echo "Shutdown function: ", `pwd`;
	};
	echo "Body: ", `pwd`;
	register_shutdown_function ("Test");
?><BR>
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             | |||||||||||||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 20:00:01 2025 UTC | 
It's very serios bug. Try this samle and try to find out 'out.txt' file. <? set_time_limit(0); ignore_user_abort(0); function Test() { $fp = fopen ('out.txt', 'w'); fwrite ($fp, 'TEST');; fclose ($fp); }; register_shutdown_function ("Test"); ?>