In my php.ini i have the following set:
session.save_handler = redis
session.save_path = "tcp://localhost:6379?weight=1"
session_start(); // Starting Session
session_set_save_handler function doesn't exactly do the same thing as the
session.set_handler configuration directive. The former expects a callable type as its first argument, whereas the latter expects a scalar value as one of the registered handlers in PHP.
What you want is to say
When you set the
session.save_path for the
redis session handler, you should avoid using hostnames that can't be resolved directly through your DNS resolver. That's pretty much anything that you put in
localhost. Instead, try using the IP address that redis is listening on directly, such as
127.0.0.1. The reason for this is that PHP won't attempt to look at
/etc/hosts directly when resolving the hostname.