编辑 php.ini 在 [Session] 添加指定你安装的memcache.so的位置。
extension=memcache.so
extension_dir = "/usr/local/php/lib/php/extensions/"
memcache.allow_failover = 1
memcache.max_failover_attempts = 20
memcache.chunk_size = 8192
memcache.default_port = 11211
session.save_handler = memcache
session.save_path = "udp://192.168.0.100:11211,tcp://192.168.0.101:11211"
一个简单的php测试脚本 test.php
<
//http://www./a.php?act=write
//http://www./a.php?act=read
session_start();
if($_GET['act']=='write')
$_SESSION['name']='0009847';
elseif($_GET['act']=='read')
var_dump($_SESSION);
else
echo 'invalid argument';
>