Edit report at http://bugs.php.net/bug.php?id=54062&edit=1
ID: 54062 Updated by: johan...@php.net Reported by: james dot mk dot green at gmail dot com Summary: PHP does not notice user abort -Status: Open +Status: Bogus Type: Bug Package: Network related Operating System: Linux/Windows PHP Version: Irrelevant Block user comment: N Private report: N New Comment: Marking bug as user error. Previous Comments: ------------------------------------------------------------------------ [2011-02-21 22:46:08] james dot mk dot green at gmail dot com As unlikely as it sounds this may be an issue within Firefox. I pasted the code from Rasmus onto the web server next door to mine. Fired it up in Firefox and PHP detected the user abort. Repeated my script but again it did not work. Slowly I worked the code from Rasmus directly in to my script but still no joy. At this point all that was different was the name of the shutdown function. Then tried using wget as the client and both scripts work. Repeated Rasmus' script from Firefox and it no longer detected user abort. So we have a bug within the client - as far as I can tell. I am least happy I can work with this, thanks for all the tests and sorry for wasting people's time! ------------------------------------------------------------------------ [2011-02-21 19:40:41] ras...@php.net By the way, why so complicated a test? Try the simple case: <?php ignore_user_abort(false); for($i=0;$i<1000;$i++) { sleep(1); $str = "Line $i\n"; echo $str; flush(); file_put_contents("/tmp/heartbeat.log", $str, FILE_APPEND); } Things that might get in the way of this working for you would be if you have some sort of reverse proxy cache in front of your web server. Like a Cloudflare, for example. Or your own setup. You could also have multiple levels of output buffering going on. You could check that case with an ob_get_level() call. ------------------------------------------------------------------------ [2011-02-21 19:21:05] ras...@php.net Works fine for me on a Debian box running mod_php with Apache prefork, and a Centos box running nginx and php-fpm. ------------------------------------------------------------------------ [2011-02-21 17:42:42] james dot mk dot green at gmail dot com johannes, it's been tested on a Windows server too (same behaviour). Besides, cataphract seems to be using Ubuntu's PHP package too. Perhaps it's something to do with web server configuration? I'm using CGI on Windows, and mod_php on Ubuntu (Apache Prefork MPM). What might cause this behaviour? ------------------------------------------------------------------------ [2011-02-21 17:39:22] johan...@php.net Please try using this snapshot: http://snaps.php.net/php5.3-latest.tar.gz For Windows: http://windows.php.net/snapshots/ Please use vanilla PHP from php.net. We have no idea what kind of patches Ubuntu applies and what they might break. ------------------------------------------------------------------------ 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/bug.php?id=54062 -- Edit this bug report at http://bugs.php.net/bug.php?id=54062&edit=1