开发者

How do I stop PHP::memcache::delete from producing a CLIENT_ERROR?

If you c开发者_高级运维all the following

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

you will get

PHP Notice: MemcachePool::delete(): Server localhost (tcp 11211, udp 0) failed with: CLIENT_ERROR bad command line format. Usage: delete [noreply]


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

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

It is explained here


Worry not. Despite what is said at the manual, explicitly passing a timeout of 0 will fix the problem.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜