不用修改PHP的设置,用以下函数
set_time_limit
(PHP 3, PHP 4 >= 4.0.0)set_time_limit -- limit the maximum execution time
Descriptionvoid set_time_limit (int seconds)
Set the number of seconds a script is allowed to run. If this is reached, the script returns a fatal error. The default limit is 30 seconds or, if it exists, the max_execution_time value defined in the configuration file. If seconds is set to zero, no time limit is imposed.