Using memcache as a session store?

前端 未结 7 1936
有刺的猬
有刺的猬 2020-12-29 11:22

I currently have a huge problem. Two days ago my site running on one server was too much, so I purchased two more and had them clustered (rsync and load balanced).

I

相关标签:
7条回答
  • 2020-12-29 12:10

    Both of the major memcache PHP PECL extensions have session handlers. Either will require you to install a PECL module before use.

    The Memcache PECL extension session handler is enabled with the following in php.ini:

    session.save_handler = "memcache"
    session.save_path = "tcp://memcacheServerAddressHere:11211?persistent=1&weight=2&timeout=2&retry_interval=10"
    

    The Memcached PECL extension session handler is enabled with the following in php.ini:

    session.save_handler = "memcached"
    session.save_path = "memcacheServerAddressHere:11211"
    

    Note that the Memcache extension appears to allow more configuration of the Memcache environment.

    0 讨论(0)
提交回复
热议问题