<?php
function _callback_memcache_failure($host, $port) {
print "memcache '$host:$port' failed";
}
/* OO API */
$memcache = new Memcache;
// Add the server in offline mode
$memcache->addServer('memcache_host', 11211, false, 1, 1, -1, false);
// Bring the server back online
$memcache->setServerParams('memcache_host', 11211, 1, 15, true, '_callback_memcache_failure');
/* procedural API */
$memcache_obj = memcache_connect('memcache_host', 11211);
memcache_set_server_params($memcache_obj, 'memcache_host', 11211, 1, 15, true, '_callback_memcache_failure');
?>