RE: [PHP] set_time_limit() in a loop

From: Date: Sun, 27 Jan 2002 20:18:15 +0000
Subject: RE: [PHP] set_time_limit() in a loop
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-82314@lists.php.net to get a copy of this message
Thanks for your reply Paul. The script is getting subscriber details from a database and then firing our personalised emails in HTML and text format. The while statement loops through the query results and fires out the emails using the mail() command. It works well so far and indeed does finish the loop OK - but as mentioned the script is still running 13 hours later. I don't get it. Any ideas? Is it possible to kill a script via PHP code? Matthew PS Here is the script again <? ignore_user_abort(true); set_time_limit(1800); while: personalise the message; mail(); set_time_limit(1800); endwhile; ?> -----Original Message----- From: Paul Roberts [mailto:roberts_paul@bigfoot.com] Sent: Sunday, January 27, 2002 12:08 AM To: Matthew Delmarter Cc: PHP Mailing List Subject: Re: [PHP] set_time_limit() in a loop what are you doing a while on if while never ends and you reset the time out each loop and use ignore_user_abort(true), it will still be going 13 hours latter. maybe if you send the full code so we can look at it. Paul Roberts roberts_paul@bigfoot.com ++++++++++++++++++++++++ ----- Original Message ----- From: "Matthew Delmarter" <matt@adplusonline.com> To: "Martin Towell" <martin.towell@world.net> Cc: "PHP Mailing List" <php-general@lists.php.net> Sent: Friday, January 25, 2002 12:55 AM Subject: RE: [PHP] set_time_limit() in a loop > I should also mention that the loop is sending mail using mail(). > > Is it possible that this is the problem somehow? > > -----Original Message----- > From: Martin Towell [mailto:martin.towell@world.net] > Sent: Friday, January 25, 2002 1:16 PM > To: 'Matthew Delmarter'; PHP Mailing List > Subject: RE: [PHP] set_time_limit() in a loop > > your first thought was correct - it sets it to 1800, it's NOT > accumulative. > > it would have something to do with ignore_user_abort(true); and also > is your while loop's exit check working? > > Martin > > > -----Original Message----- > > Just wondering about set_time_limit() in a loop. > > The current code looks something like this: > > <? > ignore_user_abort(true); > set_time_limit(1800); > while: > do stuff; > set_time_limit(1800); > endwhile; > ?> > > Does this reset the timeout to 1800 seconds every time it loops? Or > does it accumulate so that the timeout has 1800 seconds added to it > every time? > > The reason I ask is that my ISP informs me that the script is still > running 13 hours later! Or is this related to the ignore_user_abort? > > Regards, > Matthew Delmarter > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: > php-list-admin@lists.php.net > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > >

« previous php.general (#82314) next »