
ps:开启redis-server后直接在浏览器执行能成功<?php
/**
* User: xym
* Date: 2018/9/24
* Time: 下午12:13
*/
namespace app\index\controller;
use think\cache\driver\Redis;
use think\Controller;
use think\Queue;
class Test extends Redis{
public function index(){
// echo phpinfo();exit();
$redis=new Redis();
//$redis->connect('127.0.0.1',6379);
$redis->set('name','嘎嘣脆');
echo $redis->get('name');
}
}
最佳答案