Questions tagged [predis]

Predis is a flexible and feature-complete PHP client library for the Redis key-value store.

Predis requires PHP >= 5.3 and it is entirely written in PHP.

It can be used without the need to build and install a native extension for the interpreter, making it also easier and faster to add new features which is great given how fast the development of Redis proceeds.

Speed up Predis

  • support HHVM >= 2.4.0
  • can be paired with a C extension phpiredis

Frameworks integration

Useful links

254 questions
3
votes
1 answer

change the 'max number of client reached' redis error message to ''

is it possible to change the error message 'max number of client reached' to null or empty string? I'm using redis as a cache for my DB values and in cases that I can't get the values from the cache I will get it from the DB. if I could configure it…
silver
  • 1,633
  • 1
  • 20
  • 32
3
votes
1 answer

How to make Laravel work with Redis cluster on AWS

I'm trying to use Laravel (5.4) with a clustered version of Redis. I followed the instructions form this post like so: /* |-------------------------------------------------------------------------- | Redis…
abbood
  • 23,101
  • 16
  • 132
  • 246
3
votes
4 answers

Laravel Redis behavior for different browsers

I am facing problem in Redis in laravel framework. Actullay. I have done almost everything. I am putting and getting data in Redis like this:- use Illuminate\Support\Facades\Redis; public function redisSet(){ Redis::set('name', 'Taylor'); …
kunal
  • 255
  • 3
  • 17
3
votes
2 answers

Can return response from REDIS subscribe?

I use predis and i want subscribe to channel in PHP and wait 30 seconds. If not receive any messages at channel, return json response. Or if messages in channel exists, return response too and exit. For example i want, that my Redis::subscribe…
3
votes
1 answer

Laravel, Predis - how to iterate through Hashes

I have set of of hashes taxi:1 p1 v1 p2 v2 ... taxi:2 p1 v3 p2 v4 ... taxi:3 p1 v5 p2 v6 ... taxi:4 p1 v1 p2 v7 ... How do I iterate through them efficiently. My goal is to display some cards with data in a Blade template.
dbr
  • 1,037
  • 14
  • 34
3
votes
4 answers

How to delete all the cache using predis in php

I am using predis library to cache the data. I am able to delete the cache individually using $redis->cache->hdel(self::$cacheNamespace, $key); But i need to delete all the cache without providing any keys, Is there a way to achieve that in…
Lionel Dcosta
  • 177
  • 1
  • 2
  • 13
3
votes
1 answer

Storing array of objects inside Redis and retrieving it

We are using PHP, Redis, and Predis. We are trying to store an array of objects in Redis and then retrieve it. We notice arrays cannot be naturally be stored in Redis. What is the best way to store the array of objects and retrieve it later? Here is…
baileyJchoi
  • 473
  • 5
  • 17
3
votes
2 answers

Redis "unknown command" error

I use Redis as session storage in my website (Laravel 4.2). Sometimes I get following errors. I guess ">" char broke the setex commands. production.ERROR: exception 'Predis\ServerException' with message 'ERR unknown command '>'' in…
Farid Movsumov
  • 12,350
  • 8
  • 71
  • 97
3
votes
1 answer

Redis scan skipping keys

I'm using predis (with laravel if it makes any difference) php client to work with Redis. I need to fetch all the keys from Redis that match certain prefix and I do it like this: $keys = []; foreach (new Iterator\Keyspace($this->redis(),…
Andrey Zavarin
  • 1,483
  • 2
  • 13
  • 12
3
votes
1 answer

Redis SCARD returning the wrong results?

I'm adding a large number of data points into a redis set: $t = 0; $redis = Redis::Connection(); foreach($adv as $a) { $t = $t + 1; print($t); //Prints to log $test = $redis -> sadd('database/ab/AL', $a -> id); print($test);…
RN_
  • 878
  • 2
  • 11
  • 30
3
votes
1 answer

redis pub/sub subsribe returning connection error

I am on Laravel 5.1 and following the guide here: http://laravel.com/docs/5.1/redis#pubsub I created a simple socket.io server and on client side i emitted a message to my-channel, socket.io server is able to log the message. However, I ran the…
ElsT
  • 139
  • 4
  • 15
3
votes
2 answers

What is the fastest way to read multiple hashes from Redis?

I have a LIST containing pointers to some HASH data. Something like: [LIST] app:1 ["article1", "article2", "article3" ...] [HASH] article1 {title: "Hello", description: "World"} [HASH] article2 {title: "Hello", description: "World"} [HASH] article3…
Aristona
  • 8,611
  • 9
  • 54
  • 80
3
votes
1 answer

Predis - Catch connection error

Hi I have the following: // Named array of connection parameters: $redis = new Predis\Client([ 'scheme' => 'tcp', 'host' => $host, 'port' => $port, 'password' => $auth, ]); try { //…
Ricky Barnett
  • 1,130
  • 3
  • 15
  • 32
3
votes
2 answers

redis timeout with predis

I'm using redis with php (predis at http://github.com/nrk/predis/) and am experiencing frequent timeout. The stack trace shows: [04-Apr-2010 03:39:50] PHP Fatal error: Uncaught exception 'Predis_ClientException' with message 'Connection timed out'…
Patrick
  • 4,815
  • 11
  • 52
  • 55
3
votes
1 answer

Problems with using hmset in Predis

I have a problem with using $predis->hmset(). What parameters i need use? I try many variants, but without success. $this->client()->hmset( $this->name, array( 1 => 3 )) $this->client()->hmset( $this->name, array( 1, 3 ))
aieven
  • 1,939
  • 3
  • 14
  • 8
1 2
3
16 17