Page 1 of 1

time for executing script

Posted: Fri Apr 22, 2011 5:44 pm
by Jitro
hello,
I was told that this line: max_execution_time = 10 ; Maximum execution time of each script, in seconds in php.ini allows changing maximal time of execution for each script.
Sometimes my script goes into a never-ending loop because I am still new to php. Loops last longer that 10 seconds and take 100% of my CPU, then I have to kill that process in task manager :? Where can I change the max_execution_time to less then 10 seconds - for certain?
thanks in advance

Re: time for executing script

Posted: Fri Apr 22, 2011 6:09 pm
by Christopher
http://php.net/manual/en/function.set-time-limit.php

You can also use ini_set();

PS - I found this by googling "max_execution_time"

Re: time for executing script

Posted: Fri Apr 22, 2011 7:03 pm
by Jitro
Thanks but ini_set() allows setting "max_execution_time" for a particular script. In turn I set the "max_execution_time" to 10 seconds in php.ini and it doesn't take any effect. Loops never end.