Jump to content

How Is A Simple Way To prevent Browser Timeout


johnsmith153

Recommended Posts

Apparently my server times-out if the browser doesn't receive a response after 30 seconds - regardless of my php settings.

 

I am told that by sending one character to the browser can stop this time-out.

 

I am encoding video, so I do need a lengthy amount of time.

 

How would I do this so the script continues. Ie echo '<>'; I believe is only output when the script ends.

set_time_limit to prevent php from timing out the script.

 

To send one character to the screen:

 

$i=0;
while (condition is true) {
    if (($i % 300) == 0) {
        echo "<>";
        flush();
        ob_flush();
    }
    $i++;
}

 

That will only work in certain browsers, however.

 

flush; ob_flush;

Thanks premiso, any ideas which browsers it will not work on? (or which it will?)

 

I know it works in FF and IE6. Those are about the only ones I tested it on. I do not think it works on Chrome or Opera, unsure about Safari and IE > 6.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.