Causes of Memcache class delete failure in Ubuntu10.10

Source: Internet
Author: User
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:
  1. $ Mem=NewMemcache;
  2. $ Mem-> Connect ('2017. 0.0.1', 11211 );
  3. $ Mem->Delete('Key');
  4. ?>

When the result is deleted, an error is always reported:

  1. Coinsight @ insight-ubuntu :~ $ Php clear. php
  2. PHP Notice: MemcachePool: delete (): Server 127.0.0.1 (tcp 11211, udp 0)
  3. Failed with: CLIENT_ERROR bad command line format. Usage: delete [Noreply]
  4. (0) in/home/coinsight/clear. php on line 4
  5. 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:

  1. $ Mem=NewMemcache;
  2. $ Mem-> Connect ('2017. 0.0.1', 11211 );
  3. $ Mem->Delete('Key', 0 );
  4. ?>

Baidu + GG was found later for the following reasons:

  1. Nibblebot at gmail dot com 09-Jul-2010
  2. The Memcache: delete (key) function is broken on several combinations of memcached + pecl-memcache combinations.
  3. Pecl-memcache 2.2.5 + memcached 1.4.2-Memcache: delete (key) WORKS
  4. Pecl-memcache 2.2.5 + memcached 1.4.3-Memcache: delete (key) DOES NOT WORK
  5. Pecl-memcache 2.2.5 + memcached 1.4.4-Memcache: delete (key) WORKS
  6. Pecl-memcache 2.2.5 + memcached 1.4.5-Memcache: delete (key) WORKS
  7. Pecl-memcache 3.0.4 + memcached 1.4.2-Memcache: delete (key) WORKS
  8. Pecl-memcache 3.0.4 + memcached 1.4.3-Memcache: delete (key) DOES NOT WORK
  9. Pecl-memcache 3.0.4 + memcached 1.4.4-Memcache: delete (key) DOES NOT WORK
  10. 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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.