Memcached Message Error

2.5k views Asked by At

I'm using caching methods to my website, first :

apache configuration:

Listen 127.0.0.1:11211

php.ini configuration

extension=php_memcache.dll

I think everything is all right, But when trying this simple caching code :

$cache=new Memcache();
$cache->connect('127.0.0.1',11211);
$cache->set('mykey','Hello world');


echo $cache->get('mykey');

it sends me a message error :

Notice: Memcache::set() [memcache.set]: Server 127.0.0.1 (tcp 11211) failed with: Failed reading line from stream (0) on line 20 ,

Keep in mind that line 20 is $cache->set('mykey','hello world'), that means : it's already connected successfully through port 11211.

If this is a critical Bug in the Memcache library, then I would mention that I'm working on windows server , and I'd like to have "memcached" working on windows platform instead of memcache.

Thank you in advance.

1

There are 1 answers

4
Udit Trivedi On

Try to using

$cache->add('mykey','Hello world');