RE: [PHP] How to detect a PHP script time-out?
| From: | Timothy Hitchens \(HiTCHO\) | Date: | Wed, 08 Jan 2003 05:33:35 +0000 |
| Subject: | RE: [PHP] How to detect a PHP script time-out? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-130703@lists.php.net to get a copy of this message | ||
Issue... as I said before the register shutdown won't work because:
- output from the shutdown is not visible nor do you have access to some
variables
Result: no message as you wanted to show to the client.
Timothy Hitchens (HiTCHO)
Open Platform Consulting
e-mail: tim@hitcho.com.au
> -----Original Message-----
> From: Jean-Christian Imbeault [mailto:jc@mega-bucks.co.jp]
> Sent: Wednesday, 8 January 2003 3:29 PM
> To: php-general@lists.php.net
> Subject: Re: [PHP] How to detect a PHP script time-out?
>
>
> Greg Beaver wrote:
> >
> >
> > http://www.php.net/manual/en/features.connection-handling.php
>
> Nice!
>
> So if I understand correctly I need to:
>
> 1- register a shutdown function
> 2- have this function check if it was called b/c of a
> conection_timeout()
> 3- And if so have the function print out my timeout error message
>
> So in my script I could put something like this:
>
> <?php
> function timeout_message() {
> if ( connection_timeout() ) {
> echo "server busy, try again later";
> }
> }
>
> register_shutdown_function('timeout_message');
>
> [rest of my script goes here ...]
>
> ?>
>
> If the script timesout then my error function is called. Is
> that about
> right?
>
> Jc
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>