php session共用問題

來源:互聯網
上載者:User
centos 7 下安裝memcache 和 memcached擴充
經測試通過PHP可以寫入memcached
但是在php.ini 中配置save_handler = memcached
save_path = 127.0.0.1:11211
發現session並沒有寫入到memcached中
而且在/var/lib/php/session依然產生了session檔案
測試過很多次,沒有成功寫入到memcached 中,
版本資訊:
Apache/2.4.6 (CentOS) PHP/5.4.16
安裝的memcache擴充 yum -y install php-pecl-memcache
每次都產生的session檔案,問一下是怎麼回事?
phpinfo 輸出的資訊
memcache support enabled
Version 3.0.8
Revision $Revision: 329835 $

Directive Local Value Master Value
session.save_handler files memcached
session.save_path /var/lib/php/session 112.74.72.230:11211


回複討論(解決方案)

session.save_handler files memcached
session.save_path /var/lib/php/session 112.74.72.230:11211

Local Value還是用到了檔案啊。

其實可以在代碼中設定,使用php的session_set_save_handler()方法。
或者參考: http://blog.csdn.net/liruxing1715/article/details/18401875

session.save_handler files memcached
session.save_path /var/lib/php/session 112.74.72.230:11211

Local Value還是用到了檔案啊。

其實可以在代碼中設定,使用php的session_set_save_handler()方法。
或者參考: http://blog.csdn.net/liruxing1715/article/details/18401875



已經解決了,,是因為apache還有一個php相關的設定檔/etc/httpd/conf.d/php.conf ,它的優先順序比php.ini高。。。
  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.