325 Star 1.6K Fork 345

GVPswoole / swoole-src

 / 详情

协程redis设置密码后连接不上,把密码去掉后就可以连接上了

已完成
创建于  
2018-07-16 16:58
on('request', function ($request, $response) { $options = [ 'timeout' => 1.5, 'password' => 'pBLysCu25gLlz1qt' ]; $redis = new Swoole\Coroutine\Redis($options); $res = $redis->connect('127.0.0.1', 6379); var_dump($res); $value = $redis->get($request->get['a']); $response->header("Content-Type", "text/plain"); $response->end($value); }); $http->start(); 打印出来的是1,修改redis.conf把密码去掉后,再次连接就可以。。?这是什么问题呢

评论 (1)

Darker 创建了任务

需要用 $redis->auth 方法

Rango 修改任务状态为已完成

登录 后才可以发表评论

状态
负责人
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
参与者(2)
2048862 twose 1632723932 1217390 saltwaterroom 1578946511
C
1
https://gitee.com/swoole/swoole.git
git@gitee.com:swoole/swoole.git
swoole
swoole
swoole-src

搜索帮助