0
我得到错误NOAUTH认证要求。 我的laravel版本是5.3,我使用predis 1.1.1来连接redis。NOAUTH需要身份验证。 Laravel + Redis
在等/ redis的/ redis.conf我:
bind 127.0.0.1
requirepass somepassword
在.ENV文件
我
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=somepassword
REDIS_PORT=6379
在配置
/database.php中我有:
'redis' => [
'cluster' => false,
'default' => [
'host' => env('REDIS_HOST', '127.0.0.1'),
'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', 6379),
'database' => 0,
],
我通过以下方式连接Redis:
self::$_db = \Redis::connection('default');
,并用它喜欢:
self::$_db->pipeline(function ($pipe) use ($profile, $time,$type, $id) {
$pipe->zadd(self::getProfileKey($profile, $type), $time, $id);
$pipe->zadd(self::getProfileKey($profile), $time, $type . ':' . $id);
$pipe->zadd(self::getModelKey($type,$id) . '::favoritedBy', $time, $profile->profile_id);
});
所以,当我注释掉requirepass
和发送密码为空它的工作原理,但它不工作,当密码到位抛出错误NOAUTH Authentication required.
。我需要根据我的项目要求设置密码。请帮忙。提前致谢。