How to stop PHP :: memcache :: delete from creating CLIENT_ERROR?

If you call the following

$m = new Memcache()
$m->addServer('127.0.0.1')
$m->delete('key')

You'll get

PHP Note: MemcachePool :: delete (): The local server (tcp 11211, udp 0) could not be executed with: the wrong CLIENT_ERROR command line. Usage: remove [noreply]

+3
source share
2 answers

As @fratrik said, passing 0 as the second argument will make the job work.

But this is a workaround, the real problem is the incompatibility between the versions of the php-memcache extension and the memcache server.

Explained here

+5
source

Do not worry. Despite what the manual says , explicitly skipping the timeout 0will fix the problem.

+2
source

Source: https://habr.com/ru/post/1786617/


All Articles