Connecting Tech Pros Worldwide Forums | Help | Site Map

how can I offload code processing to the server like a "stored procedures "

NotGiven
Guest
 
Posts: n/a
#1: Jul 17 '05
I have a script that loops through email addresses takes long enough to time
out the web page.

Any ideas how to offload that process or avoid the timeout? Thanks.



Chung Leong
Guest
 
Posts: n/a
#2: Jul 17 '05

re: how can I offload code processing to the server like a "stored procedures "


To stop PHP from timing out, call set_time_limit(0). To keep the browser
from timing out, you need to send something to it every now and then.

At the end of the loop, do something like echo "<!-- NO TIMEOUT -->\n"; Or
if you wish to be more user-friendly--echo "<script>
ShowProgress($processed, $total); </script>\n"; where ShowProgress is a
Javascript function that update something (like a progress bar) on the page.

Uzytkownik "NotGiven" <noname@nonegiven.net> napisal w wiadomosci
news:9zWNb.5542$2L6.1313@bignews6.bellsouth.net...[color=blue]
> I have a script that loops through email addresses takes long enough to[/color]
time[color=blue]
> out the web page.
>
> Any ideas how to offload that process or avoid the timeout? Thanks.
>
>[/color]


Lucas
Guest
 
Posts: n/a
#3: Jul 17 '05

re: how can I offload code processing to the server like a "stored procedures "


calling set_time_limit(0) is a nice, however it won't override the
maximum execution time stipulated in php.ini. You may wanna have your
script executed from shell with the right parameters(consult the
manual concerning the command line parameters) and redirect the output
to /dev/null or some other place (it depends whether you need the
output or not).

Best Regards,

Lucas


"Chung Leong" <chernyshevsky@hotmail.com> wrote in message news:<pKydnZTKGv-jHJXdRVn-iQ@comcast.com>...[color=blue]
> To stop PHP from timing out, call set_time_limit(0). To keep the browser
> from timing out, you need to send something to it every now and then.
>
> At the end of the loop, do something like echo "<!-- NO TIMEOUT -->\n"; Or
> if you wish to be more user-friendly--echo "<script>
> ShowProgress($processed, $total); </script>\n"; where ShowProgress is a
> Javascript function that update something (like a progress bar) on the page.
>
> Uzytkownik "NotGiven" <noname@nonegiven.net> napisal w wiadomosci
> news:9zWNb.5542$2L6.1313@bignews6.bellsouth.net...[color=green]
> > I have a script that loops through email addresses takes long enough to[/color]
> time[color=green]
> > out the web page.
> >
> > Any ideas how to offload that process or avoid the timeout? Thanks.
> >
> >[/color][/color]
Lucas
Guest
 
Posts: n/a
#4: Jul 17 '05

re: how can I offload code processing to the server like a "stored procedures "


alternatively, you may fork off the daemon process with a signal
handler making it "independent" of any events on the client side. See
some tutorials on process control functions for further details on
this matter.


Best Regards,

Lucas


"Chung Leong" <chernyshevsky@hotmail.com> wrote in message news:<pKydnZTKGv-jHJXdRVn-iQ@comcast.com>...[color=blue]
> To stop PHP from timing out, call set_time_limit(0). To keep the browser
> from timing out, you need to send something to it every now and then.
>
> At the end of the loop, do something like echo "<!-- NO TIMEOUT -->\n"; Or
> if you wish to be more user-friendly--echo "<script>
> ShowProgress($processed, $total); </script>\n"; where ShowProgress is a
> Javascript function that update something (like a progress bar) on the page.
>
> Uzytkownik "NotGiven" <noname@nonegiven.net> napisal w wiadomosci
> news:9zWNb.5542$2L6.1313@bignews6.bellsouth.net...[color=green]
> > I have a script that loops through email addresses takes long enough to[/color]
> time[color=green]
> > out the web page.
> >
> > Any ideas how to offload that process or avoid the timeout? Thanks.
> >
> >[/color][/color]
NotGiven
Guest
 
Posts: n/a
#5: Jul 17 '05

re: how can I offload code processing to the server like a "stored procedures "


thanks


"NotGiven" <noname@nonegiven.net> wrote in message
news:9zWNb.5542$2L6.1313@bignews6.bellsouth.net...[color=blue]
> I have a script that loops through email addresses takes long enough to[/color]
time[color=blue]
> out the web page.
>
> Any ideas how to offload that process or avoid the timeout? Thanks.
>
>[/color]


Ethan T
Guest
 
Posts: n/a
#6: Jul 17 '05

re: how can I offload code processing to the server like a "stored procedures "


According to Lucas <thelucas@directbox.com>:[color=blue]
> calling set_time_limit(0) is a nice, however it won't override the
> maximum execution time stipulated in php.ini.[/color]

Actually, this is only the case if PHP is in safe mode. If not in safe mode,
the script is allowed to set the maximum execution time to whatever it wants.

--
eth'nT
http://www.hydrous.net
to email: remove all capital letters from given address


Closed Thread