Re: [PHP3] Still the problem (bug) with clients gone byebye
| From: | webmaster at www dot nisu dot flinders dot edu dot au | Date: | Thu, 10 Dec 1998 23:58:33 +0000 |
| Subject: | Re: [PHP3] Still the problem (bug) with clients gone byebye | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-2767@lists.php.net to get a copy of this message | ||
On 10 Dec, Christopher W. Curtis wrote:
> Pardon my message; it's late and I'm tired and frustrated.
>
> Okay .. here's the deal. This thing simply does not work. However,
> there are circumstances under which the script _does_ exit, I just can't
> tell what they are.
>
> This is the original script logic:
>
> while( 1 )
> query database
> print new results
>
> Closing the connection leaves this script running indefinately. Exactly
> how long I'm not sure because after a day or two it brings the server to
> its knees. Here's my test script:
>
> <?php
> while( 1 )
> print( "test" );
> ?>
>
> This runs for about 30-60 seconds after the client closes the
> connection, then exits. There is some sort of limit that can be reached
> to force an exit, but I can't for the life of me figure it out. I've
> also tried this:
>
> $rv = echo();
> -- parse error
>
> $rv = print();
> -- $rv is always (?) 1. I thought maybe I could get a 0 if the client
> was gone, but no such luck. I first used it in my test script and it
> did work, but I think now that it was simply timing out, just like the
> loop without an exit strategy.
>
> $rv = printf();
> -- This is parseable, but $rv is always a null string.
>
> Return values are not discussed in the online manual, and I see now that
> the note I added to the print() function is inaccurate. Someone needs
> to delete it or modify PHP to act in the manner I described.
>
> Does anyone know what's going with this? Apache sees the error. Does
> Apache not tell PHP, or does PHP simply not care? Is there any way to
> tell if the client has disconnected?
>
> Somebody ... PLEEZE ... :(
>
> tia,
> Chris
> --
> Oh My God! They Killed init! You Bastards!!
> make install; not war
It sounds like you might not have set a limit on the time a script can
run (or may have unset the default). In your php3.ini there is a setting
max_execution_time = 30 ; Maximum execution time of each script, in seconds
If this is set to zero, scripts will run forever. Check that it is set
to a reasonable value. You can also set this in a script - but I forget
the exact syntax for it ;-)
Cheers
--
David Robley
WEBMASTER | Phone +61 8 8374 0970
RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/
AusEinet | http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA
Visit the PHP mirror at http://au.php.net:81/
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net