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,030
  • 21
  • 100
  • 124
Carter
  • 332
  • 3
  • 13
  • Memcache server is running? Host/port is correct? – Deep Mar 17 '15 at 19:40
  • couchbase is running – Carter Mar 17 '15 at 19:48
  • Why not run Couchbase on a separate node(s) so you can grow it if you need to and then use the Couchbase PHP 2.0 SDK? That is how you will get the best performance/features out of Couchbase. – Kirk Mar 18 '15 at 16:36

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,030
  • 21
  • 100
  • 124
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,030
  • 21
  • 100
  • 124
arc_shiva
  • 127
  • 10