WARNING swManager_check_exit_status: worker#0 abnormal exit, status=0, signal=11
来源:7-11 手机号码登录 - 获取验证码(二)
![](http://img1.sycdn.imooc.com/user/54584f3100019e9702200220-100-100.jpg)
肖哒哒
2019-01-02
老师请看,就这个报错,代码和老师的一样。百度也没查出来是个啥错误,谢谢老师帮忙看看。
2回答
-
pychango
2019-02-06
go(function () use ($options, $phoneNum, $code) {
$redis = new \Swoole\Coroutine\Redis();
$redis->connect(config('redis.host'), config('redis.port'));
$redis->auth($options['password']);
$redis->setDefer();
$redis->set(SwooleRedis::smsKey($phoneNum), $code, config('redis.expir_time'));
$result = $redis->recv();
var_dump($result);
});
swoole2.x适配包括thinkphp5.1.5及以前的,我不清楚为什么老师没写go能够运行,我们就不可以。我设置了密码的,密码auth认证一定要在connect之后。想要连接成功,我建议使用go()协程。如上头代码。
不懂代码可以找我。
00 -
肖哒哒
提问者
2019-01-02
老师我断点判断,是new异步redis的时候出问题了
$redis = new \Swoole\Coroutine\Redis();
$redis->connect(config('redis.host'), config('redis.port'));
$redis->set(Redis::smsKey($phoneNum), $code, config('redis.out_time'));我的redis装好了,前面5.6章节异步redis可以使用。没问题
00
相似问题