ID: 17774 Comment by: sneakin at semanticgap dot com Reported By: neil at mpfreescene dot com Status: Bogus Bug Type: Scripting Engine problem Operating System: FREEBSD 4.7-STABLE PHP Version: PHP/4.3.0RC3 New Comment:
I tried using connection_aborted(), but I guess in 2 years time this bug hasn't been fixed. I'm using class.jabber.php, and I'm still waiting for it to disconnect from a page that got stopped. I'm using PHP 4.3.2. Previous Comments: ------------------------------------------------------------------------ [2003-04-18 14:55:18] stank at stank dot stank Same problem here. If php can abort when the user aborts, why do you have to output to tell if the user has aborted? ------------------------------------------------------------------------ [2003-02-02 11:52:48] blahstyle at hotmail dot com It's glad to meet the person who's suffering with same bug. I have two sample codes that isn't run correctly. First one: <? ignore_user_abort (true); set_time_limit (0); for($i = 1; $i < 100; $i++) { $fp = fopen("conntest.out", "wt"); fputs ($fp, $i.":".connection_aborted()."\n"); echo "\n"; flush (); fclose($fp); sleep(1); } ?> It's supposed to stop at xx:0 when user press STOP button of browser, but it isn't. The number is continued until 100. Second one: <?php function bye () { $fp = fopen ("./result.txt", "w"); fwrite ($fp, "BYE CALLED AT ".date("YmdHi",time())."\r\n"); fwrite ($fp, connection_aborted ()); fclose ($fp); die(); } register_shutdown_function ('bye'); set_time_limit ( 0 ); ignore_user_abort (true); $fp = fopen ("./result.txt", "w"); while (!connection_aborted()) { echo "\n"; flush (); sleep ( 1 ); } ?> Registered Shutdown function won't work! Neither of them worked correctly. Apache 1.3.27 + PHP 4.3.0, Win32 / FreeBSD 4.6 PHP is running as a dynamic module for Apache. ------------------------------------------------------------------------ [2002-12-13 04:05:31] neil at mpfreescene dot com ignore that, its working now, but it wasnt a minute ago. ------------------------------------------------------------------------ [2002-12-13 04:04:08] neil at mpfreescene dot com Okay, so we got the problem down to apache 2.x. ANyway, I got time to install apache 1.3.27. Now my system is running this :- SERVER_SOFTWARE Apache/1.3.27 (Unix) PHP/4.3.0RC3 And the problem still exists. I run the exact same script as shown above, which yourselfs have verified should return a '1'. The script is returning a 0, even if I press the STOP button. I have not bothered to compile gzip into this apache installation, to ensure it is not that which causes a problem. http://admin.mghost.net/~neil/test/ - script http://admin.mghost.net/~neil/test/output.txt - output file http://admin.mghost.net/~neil/test/test.cgi - standard perl diver script, to show details of my server. ------------------------------------------------------------------------ [2002-12-08 17:01:42] neil at mpfreescene dot com This may interest you :- http://nagoya.apache.org/bugzilla/show_bug.cgi?id=8996 Obviously if apaches log files are doing htat, then its completely the fault of apache 2 :-/ ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/17774 -- Edit this bug report at http://bugs.php.net/?id=17774&edit=1