Answer the question
In order to leave comments, you need to log in
Why doesn't php want to work with sessions on redis?
I ran into a problem that PHP does not want to pick up sessions from radish and work with them somehow.
Before that, the bind line was commented out and protected mode was disabled in the radish, and the firewall was also configured in order to work and connect to it from other servers. Other information is already stored in it, there is space on the disk, there is enough memory.
PHP 8.0.12, redis-cli/redis-server 4.0.9, redis 5.3.4
In php:
ini_set('session.save_handler','redis');
ini_set('session.save_path',"tcp://{$_ENV['REDIS_HOST']}:{$_ENV['REDIS_PORT']}?auth={$_ENV["REDIS_PASSWORD"]}&prefix=SESS_");
PHP Notice: session_start(): Redis not available while creating session_id in /var/www/html/***.php on line 19
PHP Warning: session_start(): Failed to read session data: redis (path: tcp://127.0.0.1:6379?auth=PASSWORD&prefix=SESS_) in /var/www/html/***.php on line 19
Answer the question
In order to leave comments, you need to log in
The solution turned out to be much easier than I thought. The password contained + and / characters.
Removed them and everything worked.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question