ID:               28195
 Updated by:       [EMAIL PROTECTED]
 Reported By:      wesleygoku at hotmail dot com
-Status:           Suspended
+Status:           Feedback
-Bug Type:         Unknown/Other Function
+Bug Type:         Scripting Engine problem
 Operating System: Windows 2000 SP4 + Apache 2.0.49
 PHP Version:      4.3.6
 New Comment:

Please try using this CVS snapshot:

  http://snaps.php.net/php4-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-STABLE-latest.zip




Previous Comments:
------------------------------------------------------------------------

[2004-08-14 20:41:13] z at tzib dot net

Apache2 works very well with PHP in most/all cases.
register_shutdown_function never worked for me in PHP4.X
I just upgraded to PHP5.0.0 and guess what! it works, well, partly:
I use the latest Apache2, and the shutdown function *gets* called (woah
:p) and connection_abort *does* return the right value !

But, as I said, just partly working. For some reason I don't know
about, if your code in the shutdown function is too large or something,
or access variable, (its quite weird so im unable to tell what it is
exactly), then it doesn't gets executed.
Eg, I go PHP launching an application and reading stdout. when the guy
close the page i want to kill the app, so i close the fd'd, call
proc_terminate and proc_close .. nothing happens. So i tried
system("kill -9 ".$pid) (i took the pid as global from another part of
the code), and never gets executed either it seems..
So i did system("killall appname"); and this one does works

Another weird thing is that php takes 20secs or more to trigger the
shutdown function once the page is closed.

------------------------------------------------------------------------

[2004-04-28 21:11:50] [EMAIL PROTECTED]

Apache 2 is not ready for production, so you're out of luck here.

------------------------------------------------------------------------

[2004-04-28 20:40:31] wesleygoku at hotmail dot com

I can't try under Apache 1.2.29 unless I reinstall this older version
of Apache and reconfigure all the server - which I can't.

I expected this problem fixed under the new Apache 2.0, which has
better support on Windows.

------------------------------------------------------------------------

[2004-04-28 09:09:11] [EMAIL PROTECTED]

Does it work with apache 1.3.29?

------------------------------------------------------------------------

[2004-04-27 23:26:33] wesleygoku at hotmail dot com

Description:
------------
The funcions connection_aborted(), connection_status() and
register_shutdown_function never work well. Using an infinite while
(while (true)) to make my WebChat work, even the user stopping the page
load, the script keep running (even when I set ignore_user_abort(0)).
When I tried to check the connection with these functions, they always
returnet TRUE, or NORMAL, even the register_shutdown_function callback
funcion ISN'T called.

And every bug report of this problem says it was corrected (since
2002), but I'm using it TODAY (with everything updated) and the problem
persists!

I'm using PHP 4.3.6 as an Apache 2.0.49 module.

Reproduce code:
---------------
set_time_limit(0);
ignore_user_abort(0);
register_shutdown_function("chat_quit");

function chat_quit () {
        // some code
        exit;
}

echo "<!-- "; for ($i = 0; $i < 20480; $i++) {echo rand(0, 9); } echo "
-->\n";
flush();

while (true) {
        // Infinite code
}

Expected result:
----------------
When the user hits 'stop', the function 'chat_quit' should be called.
Even if I change 'while (true)' to 'while (!connection_aborted())' the
loop continues.

Actual result:
--------------
The function is NEVER called.


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=28195&edit=1

Reply via email to