php代码中设置过期时间/秒
//0代表永不过期
set_time_limit (30);
//同
ini_set('max_execution_time', 30);
设置php.ini
; Maximum execution time of each script, in seconds
; http://php.net/max-execution-time
; Note: This directive is hardcoded to 0 for the CLI SAPI
;cli模式运行时此指令被硬编码为0,所以如果要设置cli过期时间需要在代码中设置
max_execution_time = 30
代码中的设置将覆盖php.ini中的配置