For this sort of thing, it may be easier to run the job from a shell. Try
compiling php as the CGI/CLI executable. Then you can run your scripts
like, say, a Perl script or whatever. Just add the ampersand at the end of
the command to run it in the background. (I'm assuming a UNIX-like system
with some sort of sh/bash-like shell.) Also remember to set the timeout to
0 at the beginning of the script using
set_time_limit(0);
You might also want to surpress output to stdout for background jobs, which
is generally preferable for UNIX background processes.
If you still want to do it via the browser, just use set_time_limit(0).
Even if you hit stop or the connection is broken, I think the script will
still execute, unless you've registered a shutdown function, but I'm not
100% positive on that one.
J
James Hudnall wrote:
I wrote a php program that has to do a lot of processing on a couple large
mySQL tables that can take hours, so often the page will time out or kick
back a cannot find server errir. But it seems by checking the DB that
records are still being updated. IS it possible the job runs in background
even though it fails to delive the final results in the browser? I don't
need the final results, it just says when the job is completed.
Ideally, I would like to run the job in the background anyway. Can that be
done?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]