Hi
Using php7 FPM, CodeIgniter 3.1.2, Redis 3.0.3.
After struggling for few hours finding the best setup for using Redis as store engine for sessions I find myself even more confused.
I have tried the following setups, and I will be glad if you have some insights of how this should be working.
Setup 1:
codeignier config
php.ini as left with default configuration.
used session_write_close() immediately after updating session data.
Result:
Codeigniter is using Redis for storing sessions but then I came across this error on heavy ajax pages:
Session: Session: Error while trying to free lock for ci_session:cq399b646bc6lstdhrcrb69k7nvu42r8:lock
I understand the logic and need of lock mechanism but anyway, it seems like CodeIgniter is not handling multiple ajax requests simultaneously.
Setup 2:
codeignier config
php.ini
Result:
nothing works!
I get the following error:
Message: is_dir(): Unable to find the wrapper "tcp" - did you forget to enable it when you configured PHP?
Filename: drivers/Session_files_driver.php
Line Number: 134
Do you guys have any idea of what should be the best way to use redis for storing sessions?
Using php7 FPM, CodeIgniter 3.1.2, Redis 3.0.3.
After struggling for few hours finding the best setup for using Redis as store engine for sessions I find myself even more confused.
I have tried the following setups, and I will be glad if you have some insights of how this should be working.
Setup 1:
codeignier config
PHP Code:
$config['sess_driver'] = 'redis';
$config['sess_save_path'] = 'tcp://redis_server_ip:server_port?auth=password&database=0&timeout=604800';
php.ini as left with default configuration.
used session_write_close() immediately after updating session data.
Result:
Codeigniter is using Redis for storing sessions but then I came across this error on heavy ajax pages:
Session: Session: Error while trying to free lock for ci_session:cq399b646bc6lstdhrcrb69k7nvu42r8:lock
I understand the logic and need of lock mechanism but anyway, it seems like CodeIgniter is not handling multiple ajax requests simultaneously.
Setup 2:
codeignier config
PHP Code:
$config['sess_driver'] = 'files';
php.ini
Code:
session.save_handler = redis
session.save_path = "tcp://redis_server_ip:server_port?auth=password&database=0&timeout=604800"Result:
nothing works!
I get the following error:
Message: is_dir(): Unable to find the wrapper "tcp" - did you forget to enable it when you configured PHP?
Filename: drivers/Session_files_driver.php
Line Number: 134
Do you guys have any idea of what should be the best way to use redis for storing sessions?