php-resque icon indicating copy to clipboard operation
php-resque copied to clipboard

How to connecting to redis with password

Open vominhtam opened this issue 8 years ago • 6 comments

Hi all,

I have issues, I want to connect to redis server which has a password. but I don't know how to do it.

Please help me. Thank you so much

vominhtam avatar Dec 22 '16 10:12 vominhtam

Simplest way is to pass "redis://ignored:{$pass}@{$host}:{$port}" to Resque::setBackend() before attempting to use Resque for anything.

danhunsaker avatar Dec 22 '16 20:12 danhunsaker

hi danhunsaker,

I have used it but, It has issuse :

fsockopen() expects parameter 2 to be long, string given

thank you so much.

vominhtam avatar Dec 23 '16 04:12 vominhtam

That shouldn't be happening if you're using dev-master...

danhunsaker avatar Dec 23 '16 06:12 danhunsaker

I using v 1.2.* . I have found solution. I use: Resque::redis()->auth('PASSWORD'); i have push to queue:high into redis. but I don't know how to run command to implement queue. i have used command

QUEUE=high APP_INCLUDE=app/queues.php php vendor/chrisboulton/php-resque/resque.php

It don't implement queue in redis

Please help me.

vominhtam avatar Dec 23 '16 07:12 vominhtam

Let me rephrase. Do not use any version other than dev-master. 1.2 is several years old, and considerably behind dev-master in both features and bugfixes. The next release is close, but not quite ready.

Once updated, the syntax I mentioned above should work properly, or you can continue setting the password manually as you are now. Then, to run the worker, the last part of your command should be vendor/bin/resque. The rest looks fine, from here.

danhunsaker avatar Dec 23 '16 08:12 danhunsaker

It is resolved thank you so much. ^^!

vominhtam avatar Dec 23 '16 09:12 vominhtam