Re: Problem with timeout

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, May 4, 2007 8:37 am, Frank Arensmeier wrote:
> I am currently working on a script that parses a given http adress by
> looking for anchor tags, background images and so on - a crawler if
> you like. The downloaded content is temporarily stored on the server
> (Mac OS X Server 10.4.9 with PHP 5) and, when the script is done, the
> content is packed into a ZIP archive. It seems that I am having
> trouble with my Apache timeout setting. Because the script downloads
> between 250 and 300MB of html, pdf, css files and so on, it is
> terminated automatically after the specified timeout setting
> (currently 1200 seconds). Setting max execution time to -1 in the
> script has no effect (which has been noticed previously on the
> php.net manual page).

You mean 0, not -1, right?...

Cuz 0 means "forever" and -1 probably doesn't mean anything at all,
unless it means 0xffffffff seconds, which is on heck of a long time.

You can often use set_time_limit inside your loop with a reasonable
number this is much longer than any single loop execution should take.

This provides you with as much time as you need to finish, without
wiping out ALL the benefits of the original intent of set_time_limit

> Is there any other way (with PHP) to come around this problem besides
> setting the time-out in the Apache config to more than 1200 seconds?

Wait a minute.

Are you talking about a PHP time limit, or an Apache time limit?!

Cuz we can't really help you much with some Apache time limit thingie...

> The Apache manual says that the time out value can only be changed
> within the core configuration scope. My initial idea was to set the
> value in a .htaccess file which unfortunately is not allowed. I might
> also add that the script is already optimized for speed so to say.

Not allowed as in you can't have .htaccess, or not allowed as in
somebody turned off the ability to change PHP's timeout setting?

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux