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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • NotGiven

    #1

    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.


  • Chung Leong

    #2
    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($p rocessed, $total); </script>\n"; where ShowProgress is a
    Javascript function that update something (like a progress bar) on the page.

    Uzytkownik "NotGiven" <noname@nonegiv en.net> napisal w wiadomosci
    news:9zWNb.5542 $2L6.1313@bigne ws6.bellsouth.n et...[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]


    Comment

    • Lucas

      #3
      Re: how can I offload code processing to the server like a &quot;stored procedures &quot;

      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(cons ult 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:<pKydnZTKG v-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($p rocessed, $total); </script>\n"; where ShowProgress is a
      > Javascript function that update something (like a progress bar) on the page.
      >
      > Uzytkownik "NotGiven" <noname@nonegiv en.net> napisal w wiadomosci
      > news:9zWNb.5542 $2L6.1313@bigne ws6.bellsouth.n et...[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]

      Comment

      • Lucas

        #4
        Re: how can I offload code processing to the server like a &quot;stored procedures &quot;

        alternatively, you may fork off the daemon process with a signal
        handler making it "independen t" 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:<pKydnZTKG v-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($p rocessed, $total); </script>\n"; where ShowProgress is a
        > Javascript function that update something (like a progress bar) on the page.
        >
        > Uzytkownik "NotGiven" <noname@nonegiv en.net> napisal w wiadomosci
        > news:9zWNb.5542 $2L6.1313@bigne ws6.bellsouth.n et...[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]

        Comment

        • NotGiven

          #5
          Re: how can I offload code processing to the server like a &quot;stored procedures &quot;

          thanks


          "NotGiven" <noname@nonegiv en.net> wrote in message
          news:9zWNb.5542 $2L6.1313@bigne ws6.bellsouth.n et...[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]


          Comment

          • Ethan T

            #6
            Re: how can I offload code processing to the server like a &quot;stored procedures &quot;

            According to Lucas <thelucas@direc tbox.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
            Personal website and photoblog of Ethan Trewhitt

            to email: remove all capital letters from given address


            Comment

            Working...