Page 1 of 1
How long should a php process run
Posted: Wed Jun 14, 2006 6:16 am
by quocbao
Hi , i just wondering how long should a php process run ?
For example : in a php script i use ignore_user_abort , set_time_limit(0) , this means this process may last forever , but it will stop , and my question is how long should it run ?
(sorry for my bad english , and i don't know where to post this question

)
Re: How long should a php process run
Posted: Wed Jun 14, 2006 8:54 am
by Chris Corbyn
quocbao wrote:Hi , i just wondering how long should a php process run ?
For example : in a php script i use ignore_user_abort , set_time_limit(0) , this means this process may last forever , but it will stop , and my question is how long should it run ?
(sorry for my bad english , and i don't know where to post this question

)
That really depends upon what you're doing.
I mean, you can write entire services in PHP. They'd want to run forever. Running PHP from command line can run as long as you like until the process is aborted manually. Even with set_time_limit(0) in a web page your script will still stop when Apache times out. ignore_user_abort() is a different situation though.
Basically.... it depends why you're asking?

Posted: Wed Jun 14, 2006 8:23 pm
by quocbao
Even with set_time_limit(0) in a web page your script will still stop when Apache times out
I didn't notice about apache timeout

, then there might be some problems.
I want to ask this question because i have a small script to send mail ( about 2 thousands

) . Yeah , i know there's another solution , but i still want to know clearly about this .
Posted: Thu Jun 15, 2006 3:12 am
by Chris Corbyn
quocbao wrote:Even with set_time_limit(0) in a web page your script will still stop when Apache times out
I didn't notice about apache timeout

, then there might be some problems.
I want to ask this question because i have a small script to send mail ( about 2 thousands

) . Yeah , i know there's another solution , but i still want to know clearly about this .
Don't try to send 2000 mails in one go is the upshot of it

Batch them max 100 at a time.