修改php配置文件,把时间定长一点就可以 了

解决方案 »

  1.   

    set_time_limit
    (PHP 3, PHP 4 )set_time_limit -- Limits the maximum execution time
    Description
    void 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 php.ini. If seconds is set to zero, no time limit is imposed. When called, set_time_limit() restarts the timeout counter from zero. In other words, if the timeout is the default 30 seconds, and 25 seconds into script execution a call such as set_time_limit(20) is made, the script will run for a total of 45 seconds before timing out. 
    警告 
    set_time_limit() has no effect when PHP is running in 安全模式. There is no workaround other than turning off safe mode or changing the time limit in the php.ini. 
     注: The set_time_limit() function and the configuration directive max_execution_time only affect the execution time of the script itself. Any time spent on activity that happens outside the execution of the script such as system calls using system(), stream operations, database queries, etc. is not included when determining the maximum time that the script has been running. See also: max_execution_time and max_input_time ini directives. 
      

  2.   

    更改php.ini中的
    max_execution_time = 30    
    max_input_time = 60
      

  3.   

    除了可以直接修改配置文件外,也可以这样在PHP代码中动态修改&恢复
    $TimeLimit=60; /*设置超时限制时间
    缺省时间为 30秒
    设置为0时为不限时 */
    @set_time_limit($TimeLimit);
    当任务完成的时候@set_time_limit(30); //恢复缺省超时设置
    不过当你的PHP打开safe mode(模式)的时候,这种方式是不可以修改的
    全面加个@可以不会在页面显示错误,但这只是自欺欺人的做法
      

  4.   

    好像大家都没理解偶的意思
    我的意思是说如果程序达到了time limit的时限,不出现错误信息,希望它继续执行下面的程序
    set_time_limit谁不会用
      

  5.   

    要求上可能有点类似asp的on error resume next
      

  6.   

    connection_timeout
    若超过 PHP 程式执行时间则传回 true。语法: int connection_timeout(void);传回值: 整数函式种类: PHP 系统功能
     
     
    内容说明 
    若 PHP 程式 (script) 执行时间超过设定值则传回 true。使用时不须输入参数。
      

  7.   

    connection_timeout
    (PHP 3>= 3.0.7, PHP 4 <= 4.0.4)connection_timeout -- Return TRUE if script timed outThis function is deprecated, and doesn't even exist anymore as of 4.0.5. 郁闷