3

I just set up PHP 5.5 with Apache on CentOS. I am also running Couchbase to handle Memcached sessions. I have one server running fine. The other keeps trying to save PHP sessions locally. I am not sure why. The PHP configuration has session.save_handler=memcached and session.save_path="cb.path:11211".

The phpinfo page still lists the temporary session path as the "local" option and the handler to files, but get_session_save_path() returns the Couchbase URL.

How do I find where the local value is being set?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Carter
  • 332
  • 3
  • 13

2 Answers2

5

File /etc/httpd/conf.d/php.conf had php_value declarations overwriting the local variable.

#php_value session.save_handler "files"
#php_value session.save_path    "/var/lib/php/session”

This solution is a variant of this Stack Overflow answer: What is the difference between local value and master value

When in doubt, use:

grep -lR 'php_value' /etc/
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Carter
  • 332
  • 3
  • 13
  • 1
    hey there. You could flesh out your answer, at least clearly explain what line you set. You can then accept your own answer, you have the right to do that, so your question won't stay there as unanswered forever.... – Félix Adriyel Gagnon-Grenier Mar 18 '15 at 01:42
  • You definitely answered my question. –  Jun 29 '16 at 15:19
0

Either you can set the runtime configuration using ini_set() or call through a .htaccess file.

  1. Using a runtime configuration

     ini_set("session.save_path", "/var/lib/php/session");
    
  2. Using a .htaccess file.

     php_value session.save_path  "/var/lib/php/session”
    
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131