memcache php doubt
Posted: Wed Jan 19, 2011 12:45 am
Hi,
I am trying to incorporate caching for my restful web services written in php. I am going to use memcache as cache server. I have installed the memcache. I followed the page http://shikii.net/blog/installing-memca ... windows-7/ for the installation.
After installation I am trying to test my memcache installation is successful or not. I write the following code for testing
But the getVersion is not returning any value. I think the connection is successful but I cannot set/get value to memcache. The result of my code is show below
Can somebody help me?
regards
Shihab
I am trying to incorporate caching for my restful web services written in php. I am going to use memcache as cache server. I have installed the memcache. I followed the page http://shikii.net/blog/installing-memca ... windows-7/ for the installation.
After installation I am trying to test my memcache installation is successful or not. I write the following code for testing
Code: Select all
$memcache = new Memcache; // instantiating memcache extension class
$memcache->connect("127.0.0.1",11211) or die ("Could not connect");
print_r($memcache);
echo "<br>";
try {
$version = $memcache->getVersion();
echo "Server version: ".$version."<br/>\n";
} catch (Exception $ex) {
echo $ex->getMessage();
}
Code: Select all
Memcache Object ( [connection] => Resource id #3 )
Server version:
regards
Shihab