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
2
votes
1 answer

Firing a Laravel event from within the Predis subscribe function

I have a Laravel php app, and a NodeJS client. Something happens in my client and I want to update my php backend, so I publish a message to a Redis channel, and in my Laravel app I have a Redis subscriber listening for messages on that…
2
votes
0 answers

PHP Websocket server subscribe for redis

it's my first question. :) So my problem is that: I have a Apache server, who use Redis(Predis) server. Also have and WebSocket server (PHP WebSocketServer, who need to "subscribe" Redis server. For subscribing I use: $pubsub =…
2
votes
1 answer

Predis Null bulk reply

Hy guys! I'm doing an optimistic locking in Predis. The problem is that the Redis documentation says that when the watched key is modified, then the execute returns a 'Null Multi-bulk reply'. How does it looks like in Predis? Sady I not found any…
Lakatos Gyula
  • 3,949
  • 7
  • 35
  • 56
1
vote
0 answers

predis bug Warning: Array to string conversion in ...\vendor\predis\predis\src\Connection\StreamConnection.php on line 366

I store a array (about 50 mb) in redis with predis/predis php lib redisClient->set(key, json_encode($array)) Save is successful, but when I try to get data got a bug Warning: Array to string conversion in…
flatron
  • 11
  • 2
1
vote
1 answer

How to use dates as scores in a redis sorted set in PHP?

I have a dynamic array of tasks objects with reminder dates. I have an idea to use a redis sorted set to implement a reminders "sorted" queue. The idea is to add tasks' reminder dates to a redis sorted set and periodically run checking if there are…
Evg127
  • 53
  • 1
  • 6
1
vote
0 answers

I have ItemResource reference in data written into redis

I use resources on api site to extend data(labels, formatting, related data ...). But when I used ItemResource writing into redis : $activeItems = Item::with('creator')->getByPublished(true)->get(); foreach( $activeItems as $item ) { …
Petro Gromovo
  • 1,755
  • 5
  • 33
  • 91
1
vote
1 answer

How to use Redis Custom Provider in Symfony 6

I have the following settings for custom provider services.yaml app.my_custom_redis_provider: class: Predis\Client factory: [ 'Symfony\Component\Cache\Adapter\RedisAdapter', 'createConnection' ] arguments: -…
mehmetsen80
  • 727
  • 1
  • 8
  • 25
1
vote
2 answers

Connecting redis cluster using Laravel giving no connection available in the pool

I want to connect redis cluster from Laravel but I am getting No connections available in the pool. My databaase.php looks like 'redis' => [ 'client' => env('REDIS_CLIENT', 'predis'), 'clusters' => [ 'default' => …
Awais Qarni
  • 17,492
  • 24
  • 75
  • 137
1
vote
0 answers

predis get error Connection refused while redis-cli ok

I have set up redis like https://redis.io/docs/getting-started/installation/install-redis-from-source/. I run a test on redis-cli that is ok. But when use predis Predis\Autoloader::register(); $client = new Predis\Client(); $client->set('foo',…
tri dang
  • 11
  • 3
1
vote
0 answers

Getting a RedisException connection refused in file PhpRedisConnector.php

I have pulled an existing laravel project that utilizes sail and Redis. The project acts as an HTTP API. The problem shows it self when im trying to hit one of the endpoints from Postman, I can see that the backend accepts the request and closes…
AbDoessing
  • 11
  • 3
1
vote
1 answer

How to execute plain Redis queries in PHP using predis

How can I send a raw command to Redis using the PHP predis package $client->executeRaw('INTERSECTS vehicle LIMIT 1000 GET geofence geofence_id'); is it something applicable
Judge Jules
  • 173
  • 10
1
vote
0 answers

Laravel/Predis - Unknown response prefix

Recently performed a small composer update on a Laravel project and started seeing errors such as this for some of our events. Exception is being thrown in predis (v1.1.10). Any ideas why the responses aren't returning one of the expected values…
Carlton
  • 5,533
  • 4
  • 54
  • 73
1
vote
0 answers

No connections available in the pool Redis

**Tried below code but it gives error had updated 'tcp://127.0.0.1:6379' => No connections available in the pool 'tcp://127.0.0.1:7000' => "MOVED 13116 127.0.0.1:7002 In one scenario it gives CLUSTERDOWN Hash not served** Unable to resolve this…
insoftservice
  • 820
  • 8
  • 15
1
vote
0 answers

Redis not saving data to docker container server

I have the following docker compose configurations: version: "3.9" services: redis: image: redis:latest volumes: - redis_data:/var/redis/data restart: always environment: ALLOW_EMPTY_PASSWORD: "yes" …
somejkuser
  • 8,856
  • 20
  • 64
  • 130
1
vote
1 answer

AWS ElastiCache Redis can't connect from Laravel, show error: No connections available in the pool

Setup Laravel 8.x cache with AWS Elasticache Redis cluster: i have tried many configure that i found. but none of them work. i tried connecting Elasticache Redis cluster from redis-cli, it works with Ping pong. But not working with laravel: (Error:…
KhacNha
  • 317
  • 3
  • 13