Questions tagged [phpredis]

A fast REDIS client library for PHP

A fast Redis client library for PHP, originally created by Owlient and as of 2017 maintained by Michael Grunder and Pavlo Yatsukhnenko on github. This library provides an API for communicating with Redis, a persistent key-value database written in ANSI-C for Posix systems.

201 questions
1
vote
1 answer

redis connection inside infinite loop

I'm creating a redis connection using phpredis client $redis = new Redis(); $redis->pconnect(loclahost, 6336, 2) ; $redis->select(15); Now I used the $redis object inside an infinite loop. while(true){ ///using redis connection object. } Around…
1
vote
0 answers

Magento/redis-session. Warning: session_start(): user session functions not defined

I am running magento shop with redis for sessions. Sometimes I am getting following error: 2014-08-04T14:18:36+00:00 ERR (3): Warning: session_start(): user session functions not defined in…
Jevgeni Smirnov
  • 3,787
  • 5
  • 33
  • 50
1
vote
1 answer

phpredis persistent connect with nginx + PHP-FPM

I have classical server configuration schema with Nginx + PHP-FPM. Most of pages on my site contain data that saved into redis. Thus it is too many indirect (through php-fpm) lite requests to redis from many independent users. I use phpredis PHP…
Ivan Velichko
  • 6,348
  • 6
  • 44
  • 90
1
vote
1 answer

redis-server crashing every 5 mins

I am setting a hash entry using phpredis which is pulling data from mysql; since i am migrating some data from my MySQL database to redis for faster access, since the amount of data/changes i am making in redis is large(4 GB), it is crashing after…
akm
  • 830
  • 6
  • 20
1
vote
2 answers

How to SORT a SET and GET the full HASH

I'm new to Redis and I have to say I love it till now :) I'm bumping into an issue I'm not sure how to solve it in the more efficient way. I have a SET of HASH. Each HASH describe a post. Here is the code to create and store the HASH: // Create the…
maxwell2022
  • 2,818
  • 5
  • 41
  • 60
1
vote
3 answers

Error in implementing message queue using redis, error in using BLPOP

I am trying to build a message queue using Redis. Whenever client sends new data, they are added to a list. Here is the code for it $client->lPush("my_queue", $data); Now there is a separate script slave.php which pops the newly arrived data and…
Neel Kamal
  • 710
  • 2
  • 10
  • 27
1
vote
1 answer

LPUSH function in redis (PHP) throwing bool(false) when I get/dump list

Alright, sooooo... The issue is this: I am LPUSH'ing a variable value to a list called "keys". When I try to get and output the value of that list... it claims the list is empty (bool(false)). The syntax seems correct. This code has worked on other…
j-grimwood
  • 351
  • 3
  • 7
  • 19
1
vote
1 answer

redis lua script call redis.call("ZREVRANGE", KEYS[1], start, end, 'WITHSCORES')

I use phpredis extension, and when I call: redis.call("ZREVRANGE", KEYS[1], start, endPos, 'WITHSCORES') in lua script, it returns array(6) { [0] => string(5) "10010" [1] => string(2) "12" [2] => string(5) "10012" [3] => string(2) "-2" [4]…
Devin
  • 33
  • 5
1
vote
1 answer

Redis + phpredis losing keys — memory overflow?

New to Redis, testing it with php on a small box with just 512Mb RAM, using phpredis client. Inserted 3m integer values into a set. But the sCard() method for that set returns only about 270k count. Is that a memory limit that I faced? How to check…
Serge
  • 1,531
  • 2
  • 21
  • 44
1
vote
1 answer

Predis: Passing value to anonymous transaction function

I'm making a transaction with Predis but I can't figure out how to pass my own variables into the anonymous transaction function. $options = array(); $x = 13; $transaction = $predis->multiExec($options, function($transaction) { //i need $x…
Martin
  • 5,197
  • 11
  • 45
  • 60
1
vote
1 answer

Redis PHP cache "ERR Not permitted"

I'm trying to get a Redis front-end cache to Wordpress to work. I get this fatal error: 2013-06-07 01:46:12: (mod_fastcgi.c.2701) FastCGI-stderr: PHP Fatal error: Uncaught exception 'Predis\ServerException' with message 'ERR operation not…
knutole
  • 1,709
  • 2
  • 22
  • 41
1
vote
0 answers

How do I switch between session handlers in run time?

I have DB session handler and I have a FILE session handler and a REDIS session handler According to some logic in my bootstrap, I would like to choose which between the two session handlers I'll use for the current request. How? The code, before…
Itay Moav -Malimovka
  • 52,579
  • 61
  • 190
  • 278
0
votes
1 answer

Call to a member function toArray() on array - predis laravel

I am trying to use redis with laravel to find similar vectors using openai embeddings. I have an example in python that looks like this: def search_similar_documents(self, entity_id, vector, topK=5): query = Query("*=>[KNN 2 @embedding $vec…
Danilo Toro
  • 569
  • 2
  • 15
0
votes
1 answer

VectorField in redis schema in laravel

I am trying to create an index in redis with the following code $schema = [ new NumericField('doc_id'), new NumericField('entity_id'), new VectorField('embedding', 'HNSW', ['DIM' => 768, 'DISTANCE_METRIC' => 'COSINE']), new…
Danilo Toro
  • 569
  • 2
  • 15
0
votes
0 answers

php-redis extension cannot connect to specific host

I have Dockerfile to build my laravue project. this is my Dockerfile FROM composer:2.0 as vendor WORKDIR /app COPY database/ database/ COPY composer.json composer.json RUN composer install \ --no-interaction \ --no-plugins \ …
noqriz
  • 11
  • 1