博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
php memcache保存session的一个设置误区
阅读量:6948 次
发布时间:2019-06-27

本文共 1085 字,大约阅读时间需要 3 分钟。

 

php中,使用memcache作为session的save handler 一般会使用如下设置:

php.ini里:

session.save_handler = memcache 

session.save_path = “localhost:11211″

项目配置里:

ini_set(“session.save_handler”, “memcache”);
ini_set(“session.save_path”, “127.0.0.1:11211″);
在网上很多资料会写成这样:
session.save_path = “tcp://localhost:11211″
就是连接前缀里添加了tcp:// 这是会导致php的memcache模块写入失败,切记一定不要添加tcp协议前缀!
 
原文:
 
session.save_path 

Defines a comma separated of hostname:port entries to use for session server pool, for example “sess1:11211, sess2:11211″.

 
 
If you want to use ‘memcacheD’ extention not ‘memcache’ (there are two diffrent extentions) for session control,  you should pay attention to modify php.ini 
Most web resource from google is based on memcache because It’s earlier version than memcacheD. They will say as following 
session.save_handler = memcache 
session.save_path = “tcp://localhost:11211″ 
But it’s not valid when it comes to memcacheD 
you should modify php.ini like that 
session.save_handler = memcached 
session.save_path = “localhost:11211″ 
Look, there is no protocol indentifier

转载于:https://www.cnblogs.com/patf/p/6894558.html

你可能感兴趣的文章
奇葩说第三季被删减版下载,奇葩说被禁资源下载
查看>>
jQuery实现slideRightShow()方法
查看>>
反编译.o到.cpp
查看>>
[LeetCode]Remove Duplicates from Sorted Array
查看>>
qtp试用期30天已经过了就无法使用,解决办法
查看>>
winform文本框怎么实现html的placeholder效果
查看>>
认识CSS样式
查看>>
[转]SQLITE3 C语言接口 API 函数简介
查看>>
Delphi XE5中使用jar包
查看>>
Python3的tcp socket接收不定长数据包接收到的数据不全。
查看>>
b2b
查看>>
第三周Java学习总结
查看>>
OGRE的安装和编译【转+改】
查看>>
获取管理员组用户
查看>>
Mysql—(2)—
查看>>
简历的分布式
查看>>
LeetCode:Rotate Array
查看>>
jquery pagination.js 分页
查看>>
DOM对象与jquery对象
查看>>
XXS level8
查看>>