Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 314 Vote(s) - 3.58 Average
  • 1
  • 2
  • 3
  • 4
  • 5
NOAUTH Authentication required. Laravel + Redis

#1
I am getting error **NOAUTH Authentication required**.
My laravel version is 5.3 and I am using predis 1.1.1 to connect redis.

in etc/redis/redis.conf I have:

bind 127.0.0.1
requirepass somepassword

in .env file I have

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=somepassword
REDIS_PORT=6379

in config/database.php I have:

'redis' => [

'cluster' => false,

'default' => [
'host' => env('REDIS_HOST', '127.0.0.1'),
'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', 6379),
'database' => 0,
],

I am connecting redis via:

self::$_db = \Redis::connection('default');

and using it like:

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);
});

So, when I comment out `requirepass` and send password as null it works but it does not work and throw error `NOAUTH Authentication required.` when the password is in place. I need to have password in place as per my project requirement. Please help. Thanks in advance.
Reply

#2
So after some research, I got a solution for this issue:

We need to add:

'options' => [
'parameters' => ['password' => env('REDIS_PASSWORD', null)],
],

In `config` array. See complete example below: 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' => 3,
],
'options' => [
'parameters' => ['password' => env('REDIS_PASSWORD', null)],
],
],

In .env file:

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=mmdgreat
REDIS_PORT=6379
Reply

#3
I solve it downgrading the predis! :D

composer require predis/predis:0.8.4

I'm using the Laravel 5.3 too! :)
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through