Timeout in HTML

Discussion in 'HTML' started by Sonnich, Jul 19, 2006.

  1. Sonnich

    Sonnich Guest

    Hi all!

    I have a PHP script, which in extreme cases take more than one hour to
    load. That is on the HTML side, where the browser by some reason might
    cut off, before the PHP has finished.

    The point is that I can see that the PHP does what it should right
    until the end, while the client side says the page could not be found.

    I should mention, that a large amount of information is sent to the
    client including an <iframe> with a reloading status message. But after
    one hour without </html> the browser (IE) goes on to "the page cannot
    be found".

    How do I overcome this?

    BR
    Sonnich
    Sonnich, Jul 19, 2006
    #1
    1. Advertising

  2. Sonnich wrote:
    > Hi all!
    >
    > I have a PHP script, which in extreme cases take more than one hour to
    > load. That is on the HTML side, where the browser by some reason might
    > cut off, before the PHP has finished.
    >
    > The point is that I can see that the PHP does what it should right
    > until the end, while the client side says the page could not be found.
    >
    > I should mention, that a large amount of information is sent to the
    > client including an <iframe> with a reloading status message. But after
    > one hour without </html> the browser (IE) goes on to "the page cannot
    > be found".
    >
    > How do I overcome this?
    >
    > BR
    > Sonnich
    >


    See set_time_limit and ini_set functions. The "ini_set" can be used to
    set the "max_execution_time" parameter value, the same thing as with
    "set_time_limit".

    --
    Mladen Gogala
    http://www.mgogala.com
    Mladen Gogala, Jul 19, 2006
    #2
    1. Advertising

  3. Sonnich

    Andy Dingley Guest

    Sonnich wrote:

    > I have a PHP script, which in extreme cases take more than one hour to
    > load.


    Make it go faster, or find some notification mechanism to tell users
    when a pre-cached version is available, so that tehy can load it
    quickly. There's no point in taking this long over a HTTP transaction,
    it's likely to get abandoned by timeout at almost any point of the
    process, including firewalls and proxies.
    Andy Dingley, Jul 19, 2006
    #3
  4. Sonnich

    Toby Inkster Guest

    Sonnich wrote:

    > I have a PHP script, which in extreme cases take more than one hour to
    > load.


    Why?

    If it's that a particular long-winded administration task (e.g. database
    re-indexing) needs to be run on the server occasionally, consider running
    the PHP as a schedules job (using e.g. cron) and outputting the result
    into a static HTML file for later viewing.

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me ~ http://tobyinkster.co.uk/contact
    Toby Inkster, Jul 19, 2006
    #4
  5. Sonnich

    Ciaran Guest

    You should look at the following:

    http://www.php.net/ignore_user_abort

    Tells PHP to keep going even if the browser disconnects. Use this with
    care! Bear in mind that a frustrated user hitting refresh 10 times in
    quick succession will end up causing 10 parallel processes to start up!

    -Ciaran
    Ciaran, Jul 20, 2006
    #5
  6. Sonnich

    Tim Roberts Guest

    "Sonnich" <> wrote:
    >
    >I have a PHP script, which in extreme cases take more than one hour to
    >load. That is on the HTML side, where the browser by some reason might
    >cut off, before the PHP has finished.
    >
    >The point is that I can see that the PHP does what it should right
    >until the end, while the client side says the page could not be found.
    >
    >I should mention, that a large amount of information is sent to the
    >client including an <iframe> with a reloading status message. But after
    >one hour without </html> the browser (IE) goes on to "the page cannot
    >be found".
    >
    >How do I overcome this?


    What do you want to overcome? You have no control over how long the
    browser will wait for an answer. It has the right to decide its own
    timeout, and give up at any time.

    If you really have an operation that will take an hour, you need to use
    some kind of periodic "refresh" scheme to have the far end keep checking
    for the job to be finished.
    --
    - Tim Roberts,
    Providenza & Boekelheide, Inc.
    Tim Roberts, Jul 22, 2006
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bob Johnson
    Replies:
    0
    Views:
    3,761
    Bob Johnson
    Aug 7, 2003
  2. Do
    Replies:
    2
    Views:
    6,364
  3. Guoqi Zheng
    Replies:
    4
    Views:
    13,023
    Guoqi Zheng
    Jun 3, 2004
  4. Just D

    IIS timeout, IE timeout or what?

    Just D, Jun 21, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    3,529
    Just D
    Jun 21, 2004
  5. Mark Probert

    Timeout::timeout and Socket timeout

    Mark Probert, Oct 6, 2004, in forum: Ruby
    Replies:
    1
    Views:
    1,280
    Brian Candler
    Oct 6, 2004
Loading...

Share This Page