PHP timeouts

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
JJunkin
Forum Newbie
Posts: 9
Joined: Fri Oct 15, 2004 9:36 am

PHP timeouts

Post by JJunkin »

My problem is with the PHP timeout. I have a huge xml object that I am trying to echo to the page but PHP timesout before it is finished doing all the echos. I also need the object to be displayed on one page. Is there anyway, besides increasing the PHP timeout, that I might avoid the PHP timeout??

Thanks,
Jason
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Possbily show us what you are trying to echo to reduce it's size...

otherwise you can do ini_set(max_execution_time 10000)
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

The function [php_man]set_time_limit[/php_man]() sets a temporary max_execution_time for the duration of the scripts processing, and it won't effect the ini variable.

Give that a go.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

ugh, thats what I meant to say
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

;)
sturmovik
Forum Newbie
Posts: 7
Joined: Thu Oct 21, 2004 2:18 pm

Post by sturmovik »

ini_set(max_execution_time 10000) and set_time_limit() do the same thing, right?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

basically, yes. Although both are disabled in safemode, I believe.
sturmovik
Forum Newbie
Posts: 7
Joined: Thu Oct 21, 2004 2:18 pm

Post by sturmovik »

feyd wrote:basically, yes. Although both are disabled in safemode, I believe.
No problem ha? Just ini_set("safe_mode","0"); and then I use normally both functions... yet, after the script ends, everything is restored to normal as far aas I know... ?
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

PHP Manual wrote: safe_mode "0" PHP_INI_SYSTEM
which means you can't change safe_mode value via ini_set
Post Reply