chrisboulton / php-resque

PHP port of resque (Workers and Queueing)
MIT License
3.43k stars 759 forks source link

How to connecting to redis with password #321

Open vominhtam opened 7 years ago

vominhtam commented 7 years ago

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

danhunsaker commented 7 years ago

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

vominhtam commented 7 years ago

hi danhunsaker,

I have used it but, It has issuse :

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

thank you so much.

danhunsaker commented 7 years ago

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

vominhtam commented 7 years ago

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.

danhunsaker commented 7 years ago

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.

vominhtam commented 7 years ago

It is resolved thank you so much. ^^!