time for executing script

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
User avatar
Jitro
Forum Newbie
Posts: 5
Joined: Sun Sep 12, 2010 7:43 pm

time for executing script

Post 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
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: time for executing script

Post 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"
(#10850)
User avatar
Jitro
Forum Newbie
Posts: 5
Joined: Sun Sep 12, 2010 7:43 pm

Re: time for executing script

Post 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.
Post Reply