问题
I just setup php55 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. Not sure why. The php config has session.save_handler=memcached
and session.save_path="cb.path:11211"
The phpinfo page still lists the temp 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?
回答1:
/etc/httpd/conf.d/php.conf had php_value declarations over writing 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 SO answer: https://stackoverflow.com/a/19520851/2358135
When in doubt grep -lR 'php_value' /etc/
回答2:
Either you can set runtime configuration using ini_set() or call through a .htaccess file
1 using runtime configuration
ini_set("session.save_path","/var/lib/php/session");
2 using .htaccess file.
php_value session.save_path "/var/lib/php/session”
来源:https://stackoverflow.com/questions/29108114/php-ini-change-local-value