ubuntu 下使用 memcache ::delete() 报错解决方案

ubuntu10.10 desktop,安装了memcached

delete 使用方式:


$mem = new Memcache; 

$mem->connect('127.0.0.1',11211); 

$mem->delete('key');

报错信息:

coinsight@insight-ubuntu:~$ php clear.php   PHP Notice:  MemcachePool::delete(): Server 127.0.0.1 (tcp 11211, udp 0) failed with: CLIENT_ERROR bad command line format.  Usage: delete  [noreply]  (0) in /home/coinsight/clear.php on line 4  coinsight@insight-ubuntu:~$ 


解决方案:在使用delete方法时,如:$memcache->delete('key', 0) 加个参数 可以设为0(0表示立即删除)  或者是其他一个数值 如10 表示10秒后删除


出错原因:

nibblebot at gmail dot com 09-Jul-2010 03:58 
the Memcache::delete(key) function is broken on several combinations of memcached+pecl-memcache combinations. 

pecl-memcache 2.2.5 + memcached 1.4.2 - Memcache::delete(key) WORKS

pecl-memcache 2.2.5 + memcached 1.4.3 - Memcache::delete(key) DOES NOT WORK

pecl-memcache 2.2.5 + memcached 1.4.4 - Memcache::delete(key) WORKS

pecl-memcache 2.2.5 + memcached 1.4.5 - Memcache::delete(key) WORKS

pecl-memcache 3.0.4 + memcached 1.4.2 - Memcache::delete(key) WORKS

pecl-memcache 3.0.4 + memcached 1.4.3 - Memcache::delete(key) DOES NOT WORK

pecl-memcache 3.0.4 + memcached 1.4.4 - Memcache::delete(key) DOES NOT WORK

pecl-memcache 3.0.4 + memcached 1.4.5 - Memcache::delete(key) DOES NOT WORK


你可能感兴趣的:(ubuntu 下使用 memcache ::delete() 报错解决方案)