Dear All,
I`m really new to memcache and I thought of trying it out in my windows machine before move out to linux server. I successfully enabled the memcached extension and also in my phpinfo() it shows it successfully installed.
Then I tried the simple code which was present in the php.net to test my memcache capability but unfortunately the script died giving following error,
Warning: Memcache::connect() [memcache.connect]: Can't connect to localhost:11211, A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. (10060) in
below is the PHP code ,
$memcache = new Memcache;
$memcache->connect('localhost', 11211) or die ("Could not connect");
$version = $memcache->getVersion();
echo "Server's version: ".$version."<br/>\n";
$tmp_object = new stdClass;
$tmp_object->str_attr = 'test';
$tmp_object->int_attr = 123;
$memcache->set('key', $tmp_object, false, 10) or die ("Failed to save data at the server");
echo "Store data in the cache (data will expire in 10 seconds)<br/>\n";
$get_result = $memcache->get('key');
echo "Data from the cache:<br/>\n";
var_dump($get_result);
what i`m doing wrong?
Thanks,
best Regards,
niroshan