addServer('127.0.0.1', 11211); // Test adding a value to memcached. if ($memcached->add($key, $value, 1)) { $result = $memcached->get($key); // If we get the expected result, it was a success. if ($result == $value) { $success = TRUE; print "Memcached connection successful.\r\n"; exit(0); } } } if (!$success) { print "Memcached not working properly.\r\n"; exit(1); }