首页
下载
文档
社区
视频
捐赠
源代码
赞助商
AOT 编译器
AI 助理
商业产品
PHP AOT 原生编译器
Swoole-Compiler 代码加密器
CRMEB 新零售社交电商系统
登录
注册
全部
提问
分享
讨论
建议
公告
开发框架
CodeGalaxy
发表新帖
swoole4.0.2-使用Coroutine\Redis无法获取到Redis的值
swoole4.0.2-使用Coroutine\Redis无法获取到Redis的值,redis是有这个key的,访问http://localhost:8001/?a=wang 没有返回值?? $http = new swoole_http_server('0.0.0.0', 8001); $http->on('request', function($request, $response) { // 获取redis 里面 的key的内容, 然后输出浏览器 $options['timeout'] = 1.5; $options['password'] = 'pBLysCu25gLlz1qt'; $options['database'] = 0; $redis = new Swoole\Coroutine\Redis(); $result = $redis->connect('127.0.0.1', 6379); $value = $redis->get($request->get['a']); $response->header("Content-Type", "text/plain"); $response->end($value); }); $http->start();
发布于6年前 · 3 次浏览 · 来自
提问
T
Tagaizer
swoole4.0.2-使用Coroutine\Redis无法获取到Redis的值,redis是有这个key的,访问http://localhost:8001/?a=wang 没有返回值?? $http = new swoole_http_server('0.0.0.0', 8001); $http->on('request', function($request, $response) { // 获取redis 里面 的key的内容, 然后输出浏览器 $options['timeout'] = 1.5; $options['password'] = 'pBLysCu25gLlz1qt'; $options['database'] = 0; $redis = new Swoole\Coroutine\Redis(); $result = $redis->connect('127.0.0.1', 6379); $value = $redis->get($request->get['a']); $response->header("Content-Type", "text/plain"); $response->end($value); }); $http->start();
赞
0
收藏
提问
分享
讨论
建议
公告
开发框架
CodeGalaxy
登录
后参与评论
评论
2019-11-14
期
期待
先要确定你的程序是否正常连接到了redis
赞
0
回复