问下为啥我执行定时任务老是报这个错误?
local.ERROR: Maximum execution time of 60 seconds exceeded {"exception":"[object] (Symfony\\Component\\ErrorHandler\\Error\\FatalError(code: 0): Maximum execution time of 60 seconds exceeded at /vendor/nesbot/carbon/src/Carbon/CarbonTimeZone.php:25)
[stacktrace]
我设置了一个定时任务
当我php artisan cache:clear 清除缓存后就又正常了,过个一两天就报上面的错误,我用的缓存是redis,问下都是为啥,是因为redis存的东西太多了吗,
还是因为定时任务进程
这么明显的提醒
超过执行时间了
解决办法:
1.找到php.ini文件,设置以下单位是s,为0代表不限制
max_execution_time = 240 ;
2.set_time_limit(0);