php ini change local value

巧了我就是萌 提交于 2019-12-10 10:39:13

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!