You are here: Re: Timeout of http request « PHP Programming Language « IT news, forums, messages
Re: Timeout of http request

Posted by Erwin Moller on 11/16/05 18:40

hakim wrote:

> Hi NG,
>
> I have my own apache server 2.0.54 running with php 4.3.10.
>
> I got a little logical problem here about http requests.
>
> I have written a small php script which waits for x seconds. Every
> second it appends the seconds to a file.
>
> I expected a timeout after 300 seconds, becouse apache is configured
> like that. But until now it doesn't matter. I can wait for more than 5
> minutes and the script finishes i see the result page.
>
> Why my browser doesn't get a timeout. Which part is responsible for a
> timeout???
>
> Here the code:
>
> <?php
>
> // All print functions do not show up on the screen until it is
> finished
> print 'Now we wait<br>';
>
> for($i = 1; $i <= 360; ++$i) {
> sleep(1);
> print "$i<br>";
> $handle = fopen('test.dat', "a");
> fwrite($handle, $i . "\n");
> fclose($handle);
> }
>
> print '<br><br>End...<br>';
>
> ?>
>
>
> Thanks...

Hi,

PHP has its own timeout.
It is defined in php.ini

The option you need is max-execution-time.

http://nl2.php.net/manual/en/ref.info.php#ini.max-execution-time

You can overrule this setting on most systems in your script with:
ini_set("max-execution-time" , 600);
for 600 seconds.

Good luck
Regards,
Erwin Moller

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация