全新安装的程序
在修改了app\index\Index.php文件
cache 开启了 redis
<?php
namespace app\index\controller;
use think\Controller;
use think\facade\Cache;
class Index extends Controller
{
public function index()
{
$name = Cache::remember('name',function(){
return time();
});
echo $name;
Cache::clear();
}
}然后就报错Serialization of 'Closure' is not allowed 最佳答案