By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,348 Members | 1,397 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,348 IT Pros & Developers. It's quick & easy.

Please help: Prevent time-outs

P: n/a
Hi All !

Could somebody help me out on this one:

My script needs to execute a time consuming process which might take
as long as an hour or so to finish. Usually, the time limit would
produce a time out after 30 seconds or so. Modifying the
set_time_limit() does not resolve the problem since the browser then
shows a could not display page error after 2 minutes or so.

Also, I do not need to wait for browser output after the process
finishes. Instead the server would send me an email.

In short words:
How can I get a script to work during an hours so without producing a
time-out and being able to close the browser upon starting the script.
Sort of "Fire and Forget".

Your help is greatly appreciated.
Jerry
Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a

"Jerry" <su*********@lycos.com> wrote in message
news:j9********************************@4ax.com...
Hi All !

Could somebody help me out on this one:

My script needs to execute a time consuming process which might take
as long as an hour or so to finish. Usually, the time limit would
produce a time out after 30 seconds or so. Modifying the
set_time_limit() does not resolve the problem since the browser then
shows a could not display page error after 2 minutes or so.

Also, I do not need to wait for browser output after the process
finishes. Instead the server would send me an email.

In short words:
How can I get a script to work during an hours so without producing a
time-out and being able to close the browser upon starting the script.
Sort of "Fire and Forget".

Your help is greatly appreciated.
Jerry


Does running the script from the command line (php -f script.php) not suit
your purposes?

Garp
Jul 17 '05 #2

P: n/a
"Jerry" <su*********@lycos.com> wrote in message
news:j9********************************@4ax.com...
Hi All !

Could somebody help me out on this one:

My script needs to execute a time consuming process which might take
as long as an hour or so to finish. Usually, the time limit would
produce a time out after 30 seconds or so. Modifying the
set_time_limit() does not resolve the problem since the browser then
shows a could not display page error after 2 minutes or so.

Also, I do not need to wait for browser output after the process
finishes. Instead the server would send me an email.

In short words:
How can I get a script to work during an hours so without producing a
time-out and being able to close the browser upon starting the script.
Sort of "Fire and Forget".


To prevent browser time out you need to send something--a HTML comment
perhaps--to it every now and then. Not a good solution though for a script
that runs for an hour, since a lot of data could be transferred in that time
and the browser could crash from the massive DOM tree.

register_shutdown_function() might be what you're looking for.
Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.