Can PHP script terminate even if set_time_limit(0) is set?

Marc Smith

New Member
I am trying to track down what appears to be a very strange bug. I have an application that is structured roughly as follows:\[code\]set_time_limit(0);register_shutdown_function('logScriptCompletion');function logScriptCompletion() { log('script completed');}log('script started');// do some calculations periodically printing out progress\[/code\]The script can take a while to run. The desired behavior is for the script to continue computing to the end even if the stop button is hit or the connection is dropped. 99% of the time it works as expected.Once in a while (maybe once every few months/couple of thousand requests) the calculation does not run all the way through but both "script started" and "script completed" are logged and no other error fatal or otherwise is apparent (I have full logging enabled). I have a suspicion that this may have something to do with a connection to the server being dropped but have no hard evidence to confirm. I am running Apache 2/PHP 5.2.6 on Linux. Has anyone else seen a similar issue and can help shed some light on this?
 
Back
Top