Created
September 6, 2012 22:08
-
-
Save glynrob/3660740 to your computer and use it in GitHub Desktop.
Check connection to memcache server
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$memcache = new Memcache; | |
$memcache->connect("localhost",11211); | |
echo "Server's version: " . $memcache->getVersion() . "<br />\n"; | |
$data = 'This is working'; | |
$memcache->set("key",$data,false,10); | |
echo "cache expires in 10 seconds<br />\n"; | |
echo "Data from the cache:<br />\n"; | |
var_dump($memcache->get("key")); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment