php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44093 ignore_user_abort() sometimes do not work !
Submitted: 2008-02-10 19:57 UTC Modified: 2010-06-15 22:51 UTC
Votes:3
Avg. Score:3.3 ± 1.7
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:0 (0.0%)
From: max at tehnomir dot com dot ua Assigned:
Status: No Feedback Package: *General Issues
PHP Version: 5.2.5 OS: Linux 2.6.20.2
Private report: No CVE-ID: None
 [2008-02-10 19:57 UTC] max at tehnomir dot com dot ua
Description:
------------
Hello !

ignore_user_abort( false ) sometimes do not work !

In this example when I press STOP button in my browser script does not stop. It runs till max_execution_time is reached.

Server: 1.3.39.


Reproduce code:
---------------
<?

ignore_user_abort( false );

$fp = fopen('testfile.txt', 'w');

while (true)
{
	echo date('d.m.Y H:i')."<br>";
	flush();

	fwrite($fp, date('d.m.Y H:i:s')."\n");
	sleep( 1 );
}

fclose( $fp );

?>

Expected result:
----------------
Script must stop execution.

Actual result:
--------------
Script runs till max_execution_time is reached.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-04-26 13:50 UTC] pcdinh at gmail dot com
This bug remains still. I can reproduce it on PHP 5.2.5 and latest PHP 5.3dev (Windows XP SP2)

Maximum execution time of 60 seconds exceeded in D:\webroot\bugs\44093.php
 [2008-07-17 12:16 UTC] marcus dot mueller at grintsch dot com
I can confirm this bug still being reproducible in PHP 5.2.6 on Linux 2.6.24 and above. Any news?
 [2008-09-18 07:53 UTC] taworn at yahoo dot com
I can confirm this bug, too.  Even with ignore_user_abort(TRUE).

However, after I changed from using PHP as CGI to Apache module, its work.

Taworn T.
 [2010-01-28 21:38 UTC] max at tehnomir dot com dot ua
Two years past. no result :(
 [2010-01-29 13:20 UTC] jani@php.net
Please try using this snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/

And if it happens, update the version field and tell a bit more about your configuration. And with what SAPI it happens with.
 [2010-02-06 01:00 UTC] 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".
 [2010-06-15 22:27 UTC] info at romanmatena dot cz
php 5.3 windows also linux, still have the same problem, still doesnt work
 [2010-06-15 22:32 UTC] info at romanmatena dot cz
two years the same problem, the problem is in use of sleep, if you use sleep function so ignore_user_abort doesnt work
 [2010-06-15 22:51 UTC] rasmus@php.net
It can only catch the abort on output.  If you are in a sleep it obviously won't 
work.  I can't reproduce the original report in 5.3.
 [2010-06-22 15:16 UTC] info at romanmatena dot cz
the sleep is in cycle, for one second so there is any chance to kill this process
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 10:01:29 2024 UTC