引用來源:http://blog.darkhero.net/?p=250
如果你用的 php, php-memcache 版本夠新…
可以很輕易的將 Session 用 memcached 保存了…
session.save_path string Defines a comma separated of server urls to use for session storage, for example "tcp://host1:11211, tcp://host2:11211". Each url may contain parameters which are applied to that server, they are the same as for the Memcache::addServer() method. For example "tcp://host1:11211?persistent=1&weight=1&timeout=1&retry_interval=15" |
代碼: |
<?php $session_save_path = "tcp://$host:$port?persistent=1&weight=2&timeout=2&retry_interval=10, ,tcp://$host:$port "; ini_set('session.save_handler', 'memcache'); ini_set('session.save_path', $session_save_path); ?> |
沒有留言:
張貼留言