Connecting Tech Pros Worldwide Help | Site Map

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

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 17th, 2005, 02:28 AM
NotGiven
Guest
 
Posts: n/a
Default how can I offload code processing to the server like a "stored procedures "

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.



  #2  
Old July 17th, 2005, 02:28 AM
Chung Leong
Guest
 
Posts: n/a
Default 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]


  #3  
Old July 17th, 2005, 02:35 AM
Lucas
Guest
 
Posts: n/a
Default 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]
  #4  
Old July 17th, 2005, 02:35 AM
Lucas
Guest
 
Posts: n/a
Default 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]
  #5  
Old July 17th, 2005, 02:36 AM
NotGiven
Guest
 
Posts: n/a
Default 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]


  #6  
Old July 17th, 2005, 02:57 AM
Ethan T
Guest
 
Posts: n/a
Default 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


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.