Re: What happens when the execution time limit is exceeded?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 06 Mar 2014 at 14:02, Christoph Becker <cmbecker69@xxxxxx> wrote: 

> Tim Streater wrote:
>
>> It would seem that exceeding the execution time can be caught by
>> declaring a handler with set_error_handler. However, even though I'm
>> sure I've read something about it somewhere, I can't now find any
>> info about what happens next. Specifically, inside my error handler,
>> how long does the error handler then have to clean up? Can I do
>> set_time_limit() again and return? (not that I'm minded to, but it
>> might be useful to someone).
>>
>> I seem to have enough time to output some stuff back to the browser
>> and log an error message or two, but it might be useful to know the
>> actual limits.
>
> You can't catch a timeout with set_error_handler(), because it is a
> fatal error.  The only option you have is using
> register_shutdown_function() (which does not allow to return).  It seems
> that the registered shutdown function resets the timeout once.

Ah, thanks. My shutdown_function in fact calls my error_handler, so that explains it.

> Anyway, it seems better to prolong the timeout limit by calling
> set_time_limit() in advance, when you're expecting a long execution time.

Oddly enough :-) that's actually what I do. But understanding what happens is important.



--
Cheers  --  Tim

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux