Monitoring PHP's session data in Redis

243 views
Skip to first unread message

Dinh Ngoc

unread,
Sep 9, 2015, 1:26:08 AM9/9/15
to Redis DB
Hi everyone,

I just take a look Redis database some days ago. It's really interesting and good for my job. I have a task is change PHP's SESSION management to Redis. By following this link https://github.com/phpredis/phpredis I can config save_handler and save_path in php.ini using redis. But now I don't know how to check to make sure PHP's session data are saved in redis database. I tried with some commands like "KEYS *" or some thing like that but there is nothing to see. Please help me.


Paulino Huerta

unread,
Sep 9, 2015, 4:25:17 AM9/9/15
to redis-db
Once expressed in php.ini

session.save_handler = redis
session.save_path = "tcp://localhost:6379"


You should confirm the variable values,  checking the "session" section of phpinfo() output.

If everything works is Redis who store the "sessions" (only the sessions) not using files for this purpose.

Regards

2015-09-09 7:04 GMT+02:00 Dinh Ngoc <hongngo...@gmail.com>:
Hi everyone,

I just take a look Redis database some days ago. It's really interesting and good for my job. I have a task is change PHP's SESSION management to Redis. By following this link https://github.com/phpredis/phpredis I can config save_handler and save_path in php.ini using redis. But now I don't know how to check to make sure PHP's session data are saved in redis database. I tried with some commands like "KEYS *" or some thing like that but there is nothing to see. Please help me.


--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+u...@googlegroups.com.
To post to this group, send email to redi...@googlegroups.com.
Visit this group at http://groups.google.com/group/redis-db.
For more options, visit https://groups.google.com/d/optout.

Dinh Ngoc

unread,
Sep 9, 2015, 5:31:01 AM9/9/15
to Redis DB
Yes, I checked the session with phpinfo(), everything is ok like "phpinfo.png" (please take a look attachment file). But I want to confirm that  all PHP's session data should be saved in redis memory database.


Vào 15:25:17 UTC+7 Thứ Tư, ngày 09 tháng 9 năm 2015, paulinohuerta đã viết:
phpinfo.png

Paulino Huerta

unread,
Sep 9, 2015, 7:40:25 AM9/9/15
to redis-db
as shown
session.save_handler has a local values "user" (must be redis)  while the master values is "redis".
It's likely that there is an override in other configuration files, (for example /etc/httpd/conf.d/php.conf or similars)

For fix, removes these value in those files.

Dinh Ngoc

unread,
Sep 9, 2015, 11:01:09 PM9/9/15
to Redis DB
Many thanks, it works now :)

Vào 18:40:25 UTC+7 Thứ Tư, ngày 09 tháng 9 năm 2015, paulinohuerta đã viết:
Reply all
Reply to author
Forward
0 new messages