ID: 30301 Comment by: ecarpenter at itex dot co dot za Reported By: phpbug at zone-mr dot ath dot cx Status: No Feedback Bug Type: IIS related Operating System: Windows 2003 Server PHP Version: 5.0.2 New Comment:
I am having the same problem on SuSE Linux 9.3 running Linux 2.6.11.4-21.9-default, Apache 2.0.53 and PHP 4.3.10 (cli) (built: Aug 31 2005 16:14:46) The script below can be used to recreate the problem. After I have press the Stop button (Firefox 1.0.7) the script continues to execute until it is killed 15 minutes later without the shutdown function being executed. <? function foo() { exec("echo '".date("Y/m/d H:i:s")." Terminating Status:".connection_status()."' >> /tmp/test"); } register_shutdown_function('foo'); exec("echo '".date("Y/m/d H:i:s")." Starting' > /tmp/test"); $count=0; while (true) { $count++; exec("echo '".date("Y/m/d H:i:s")." Running ".$count." Status:".connection_status()."' >> /tmp/test"); } ?> Previous Comments: ------------------------------------------------------------------------ [2005-10-11 10:51:26] klimov at mmk dot ru I have tried PHP 4.4.0 and 5.0.5 and latest cvs. My server is running on Windows 2003 with IIS 6. The functions connection_aborted and connection_status doesn't work properly too. ------------------------------------------------------------------------ [2005-03-15 01:00:14] php-bugs at lists dot php dot net No feedback was provided for this bug for over a week, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open". ------------------------------------------------------------------------ [2005-03-07 22:06:04] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php5-latest.tar.gz For Windows: http://snaps.php.net/win32/php5-win32-latest.zip ------------------------------------------------------------------------ [2004-10-01 14:25:06] phpbug at zone-mr dot ath dot cx Description: ------------ I have seen similar bug reports for Apache2 (where the issue is still unresolved, but none for IIS 6.0). I have tried two different servers, and both PHP 5.02 and PHP4.39. Each server was running Windows 2003 with IIS 6 and exhibits the same symptons. Connection_status reports 0, even when the stop button is pressed, and there is no browser listening to the script output. Connection_abort also returns false. Reproduce code: --------------- ignore_user_abort(???); //Tried both true and false, no difference while (connection_status()==0) { sleep(1); echo "test\n"; flush(); ob_flush(); ... //Log an "I'm still here" timestamp, for debugging if(connection_aborted()) { //Log a disconnection into a DB exit; } } //Log a disconnection into a DB Expected result: ---------------- When the browser window or connection is closed, I expect the script to stop logging the "I'm still there" message every second, and terminate execution. Actual result: -------------- The script continues to run, updating the timestamp every second, until the time limit is reached. Connection_aborted, connection_status seem to indicate the connection is still active (but it isn't - the browser is closed, netstat confirms that there are no connections). ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=30301&edit=1