|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-09-17 11:51 UTC] jason at thinkingman dot org
[2002-12-08 10:44 UTC] sniper@php.net
[2010-05-20 00:25 UTC] xxleite at gmail dot com
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 16:00:01 2025 UTC |
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