This is a discussion on Please help: Prevent time-outs within the alt.comp.lang.php forums, part of the PHP Programming Forums category; Hi All ! Could somebody help me out on this one: My script needs to execute a time consuming process which ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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 |
|
|||
|
"Jerry" <submitstuff@lycos.com> wrote in message news:j9m5c05quvpmv2llggvikl248qofav0ie8@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 |
|
|||
|
"Jerry" <submitstuff@lycos.com> wrote in message
news:j9m5c05quvpmv2llggvikl248qofav0ie8@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. |