You have to be careful, though, because I had this problem..

I had PHP running as a CGI on the host with Apache, and Apache had a
nasty habit of terminating the CGI communicationg before PHP had
finished mailing everyone, even if set_time_limit(0); was set (well,
even if set_time_limit(arbitrarily_big_number); was used).

I ended up using an exec call to a shell script, which executed the PHP
CLI binary with a custom php.ini, and as a background process. The mails
successfully send, now. And yes, it's a convoluted way, but as it turns
out, it was the only way to properly background it and run all the way
until it ends.

So be careful if you decide to rely on set_time_limit()..

Josh.

Manuel Lemos wrote:
Hello,

on 09/12/2005 10:50 AM Ryan A said the following:

The thing that bothers me the most is if the program times out..., how do I
start again from
the ones that have not been sent?


Use set_time_limit(0); and your script will never timeout. Anyway, long standing scripts should be run off your Web server, maybe started from by cron.


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

Reply via email to