Memcached::getStats not working with Couchbase

2019-08-08 15:43发布

问题:

I recently set up a server that I'm running Apache, PHP, and Couchbase on. However, I've been having problems testing the Couchbase installation. In the past, the way I would test that everything is working is with a simple script to run getStats on Couchbase:

<?php
  $memcache = new Memcached();
  $memcache->addServer('127.0.0.1', 11211);
  $result = $memcache->getStats();
  print_r($result);
?>

This used to return the normal array of statistics. Lately, though, it doesn't return anything and there aren't any errors being produced in any of my logs. At the same time, I can still get/set key->values and actually use Couchbase to my hearts content. Did something change in PHP, the Memcached module, or somewhere else or what am I missing in order to have getStats work again?

I'm running: - Pecl Memcached 2.0.1 - PHP 5.3.10 - Couchbase 1.8.0

Thanks!

回答1:

Sounds like an issue with moxi. You may want to kill the moxi process, which will automatically respawn. If it then starts working then it's probably a moxi issue. It'd be good to have a bug report.

Note that you can go around moxi with the official Couchbase PHP client. That is designed to be pretty close API wise to PECL memcached.

Full disclosure: I work for Couchbase.