From: Adam L. <apl...@gm...> - 2008-08-26 00:50:15
|
I had these same thoughts. If you are simply scraping one page, 60 seconds is extremely long. Like Jough says, some spider activity might take that long, but processing one scrape seems kind of crazy for that long of execution time. Maybe describe what you're up to and see if someone can help you optimize the process. I'm imagining a bunch of nested FOR loops in my head, or something else that could be done more efficiently. My $.04 (Jough, you have to adjust for inflation and weak currency. Don't sell yourself short.) Adam P. Larsen apl...@gm... On Mon, Aug 25, 2008 at 7:43 PM, Jough Dempsey <jou...@gm...> wrote: > Not that the previous answers won't work, but I'm wondering if just > taking off the safeties that are in place to stop things like scripts > that take a minute or two is really the Right Answer. > > A minute in PHP execution is a LONG time. Is what the script is doing > really that intensive, or are you just executing the same operations > many times (e.g. if you were writing a spider that would request > thousands of web pages)? Even then, you should be careful that your > script isn't doing Bad Things or capitalizing things Inappropriately. > > Regardless, I'd suggest setting max_execution_time to a higher value, > but not "0" which means your script just runs and runs and runs. > > Also, setting the php.ini directive means that all PHP scripts will > run up until that max execution time, which also may not be what the > doctor ordered. > > You can use the set_time_limit(int) function instead: > > http://us.php.net/manual/en/function.set-time-limit.php > > And you get the added benefit of having it reset every time it's > called, which is really helpful if you use it in a loop where it > resets the counter per iteration, but doesn't stop the script from > timing out when it is doing something Bad. > > My $.02 (USD, now worth much less than it used to be). > > -- Jough > > > On Mon, Aug 25, 2008 at 6:39 PM, Neil Rest <Nei...@rc...> wrote: >> Bingo! >> >> max_execution_time did it. >> >> Thank you Pete, thank you Wilfried. > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > chiPHPug-discuss mailing list > chi...@li... > https://lists.sourceforge.net/lists/listinfo/chiphpug-discuss > |