Skip to content

Instantly share code, notes, and snippets.

@isopan
Last active August 29, 2015 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save isopan/9d2e34c5fe57e4a9cbdf to your computer and use it in GitHub Desktop.
Save isopan/9d2e34c5fe57e4a9cbdf to your computer and use it in GitHub Desktop.
<?php $memcache = new Memcache();
$memcache->connect("127.0.0.1",11211);
$memcache->set('key', 'value');
$v = $memcache->get('key');
var_dump($v);
$memcache_slave01 = new Memcache();
$memcache_slave01->connect("192.168.100.11",11211);
$v = $memcache_slave01->get('key');
var_dump($v);
$memcache_slave02 = new Memcache();
$memcache_slave02->connect("192.168.100.12",11211);
$v = $memcache_slave02->get('key');
var_dump($v);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment