thinkphp5.1使用redis并使用

创建一个redis类

'172.21.20.13',
//        'port'=>'6379',
//        'timeout'=>'0',
//        'retry'=>'0',
//        'readTimeout'=>'0',
//        'auth'=>'ZJ1X8fZRuQndScDF7rTW'
//    );

    private  $redis = array(
        'host'=>'127.0.0.1',
        'port'=>'6379',
        'timeout'=>'0',
        'auth'=>''
    );

    public function __construct()
    {
        $this->host    ='127.0.0.1';  //主机域名
        $this->port    ='6379';  //端口
        $this->timeout =$this->redis['timeout'];  

你可能感兴趣的:(thinkphp5,PHP)