Memcached was installed in Ubuntu10.10Desktop, and a PHP file was written to test Memcache: & lt ;? Php $ mem = newMemcache; $ mem-& gt; connect ('2017. 0.0.1 ', 11211); $ mem-& gt; Memcached is installed in delet Ubuntu 10.10 Desktop, and a PHP file is written to test Memcache:
-
- $ Mem=NewMemcache;
- $ Mem-> Connect ('2017. 0.0.1', 11211 );
- $ Mem->Delete('Key');
- ?>
When the result is deleted, an error is always reported:
- 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 :~ $
After finding the cause for half a day, you can add a parameter after the delete statement, and the parameter must be 0. Other values also report an error:
-
- $ Mem=NewMemcache;
- $ Mem-> Connect ('2017. 0.0.1', 11211 );
- $ Mem->Delete('Key', 0 );
- ?>
Baidu + GG was found later for the following reasons:
- Nibblebot at gmail dot com 09-Jul-2010
- 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
Solution: (1) manually install the corresponding version (2) Add a parameter 0 to the delete function.