PHP sessions not being saved in memcache

26

First, we created a simple page that spit out phpinfo(). Note that it is important that you run this thru the web server – running php -i DOES NOT include any overrides that apache may add.

Under the session section, the output lists all the directives, and a “Local Value” and a “Master Value”.

The local values had:

session.save_handler files
session.save_path /var/lib/php/session
while the master values had:

session.save_handler memcache
session.save_path tcp://:11211
It turns out that there’s an override installed by default in /etc/httpd/conf.d/php.conf that specifies the files. This appears to be a Redhat/CentOS/Fedora thing.

Removing those values from php.conf fixed the problem.
#php_value session.save_handler “files”
#php_value session.save_path    “/var/lib/php/session”

Source https://stackoverflow.com/questions/24184568/php-sessions-not-being-saved-in-memcache
Comments