View Single Post
Old 06-21-2008, 04:10 PM   #2 (permalink)
Salathe
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

In most circumstances, in particular websites, you shouldn't want a script to be running for 30 seconds or longer. If a page took that long to load, chances are your visitors would have gone elsewhere way before 30 seconds elapsed but it's a good point to cut off further execution to prevent things running for a long time (for any number of reasons). The official reasoning (from the PHP Manual) would be that it "helps prevent poorly written scripts from tying up the server".

Rather than changing the php.ini settings, which will affect every PHP file, you can change the values just for the currently running script (unless running under 'safe mode') by using ini_set() (for max_execution_time and memory_limit).
Salathe is offline  
Reply With Quote
The Following User Says Thank You to Salathe For This Useful Post:
Dave (06-22-2008)