Bug #17461 Updated: register_shutdown_function() timeout problem
| From: | jason at thinkingman dot org | Date: | Mon, 15 Jul 2002 20:16:08 +0000 |
| Subject: | Bug #17461 Updated: register_shutdown_function() timeout problem | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-14238@lists.php.net to get a copy of this message | ||
ID: 17461
Updated by: jason@thinkingman.org
-Reported By: jason@thinkingmna.org
+Reported By: jason@thinkingman.org
Status: Open
Bug Type: Scripting Engine problem
Operating System: Windows 2000 SP2
PHP Version: 4.2.1
New Comment:
Please note -- there was a type-o in my email address: my correct email
address is jason@thinkingman.org (not, jason@thinkingmna.org)
;-)
Previous Comments:
------------------------------------------------------------------------
[2002-05-27 14:11:04] jason@thinkingman.org
REGISTER_SHUTDOWN_FUNCTION() doesn't work on TIMEOUT for the Win32
platform.
I've tried this under PHP versions 4.1.1 and 4.2.1 -- same thing
happens. Here's a sample script:
1: ?>
2:
3: set_time_limit(1);
4:
5: function clean_up()
6: {
7: print("Script Terminated\n");
8: }
9:
10: register_shutdown_function("clean_up");
11:
12: while(1);
13:
14: ?>
Here's the error:
-----------------
Fatal error: Maximum execution time of 1 second exceeded in
C:\timeout_code.php on line 7
When this script TIMES-OUT, the REGISTER_SHUTDOWN_FUNCTION() will
"attempt" to run the function "clean_up" but will *immediately*
generate the error above in the 1st line (line 7, in this case) of the
"clean_up" function -- no matter what it is, and then the script
terminates.
Now -- if I use the REGISTER_SHUTDOWN_FUNCTION() with an EXIT (instead
of a TIMEOUT), the function works fine... it *just* seems to be a
TIMEOUT issue.
The REGISTER_SHUTDOWN_FUNCTION() needs to ignore the TIMEOUT (timer??)
-- and proceed to run any code it's programmed to run.
Just a Note: I understand that PRINT() and a few other functions will
not work when a REGISTER_SHUTDOWN_FUNCTION() is called and *run*
SERVER-SIDE -- however, I am running this script from the COMMAND-LINE
and PRINT() does work here, even with a REGISTER_SHUTDOWN_FUNCTION() --
so PRINT() isn't the problem... Just for giggles, I've replaced the
PRINT() function with an ERRORLOG() function, in an attempt to write
the output to disk -- SAME ERROR and exits on line 7 -- never executing
the code.
Thanks
Jason Caldwell
jason@thinkingman.org
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=17461&edit=1