Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

phpredis with Redis to go

I got a problem similar to this one:

Connecting to Redis To Go with PHP

Basically, I have this uri in redis to go:

redis://myusername:[email protected]:9998

and I am trying to connect to it using phpredis:

$r->connect("redis://myusername:[email protected]:9998/");

And it's not working. In that other answer it is suggested to use predis, but I just don't want to. I should be free to use whatever client I want.

Any ideas?

Thanks in advance

like image 933
john smith Avatar asked Mar 07 '26 16:03

john smith


1 Answers

Use this instead:

$r = new Redis();
$r->connect("herring.redistogo.com", 9998);
$r->auth("foopassword");

If that doesn't work, try $r->auth("myusername:foopassword") instead.

You can find the phpredis documentation on the official GitHub page.

like image 184
Nicolas Favre-Felix Avatar answered Mar 10 '26 07:03

Nicolas Favre-Felix



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!