I have RHEL6.1 with php. I've installed libmemcached-1.0.2 from src.rpm and compiled php-memcached 2.0.0b2. If I try to setSaslAuthData('user','pass') and write something to memcached (Couchbase server) I always end up with return code 5 (WRITE FAILURE). Commenting setSaslAuthData out turns to work with default bucket. But I need to get it working with SASL. Any ideas on what's wrong with my setup?
P.S. of course binary protocol is ON
Are you sure memcached is compiled with sasl?
$ memcached -S
You should see this output if memcached wasn't compiled with SASL: "This server is not built with SASL support."
When you setup a bucket you can provide a password. Then use SASL to connect to Couchbase Server by using the name of the bucket as username and the password you provided earlier.
Extended, 2011-12-11
I've been reading the source of the memcached extension. Generally, it seems like they are not too many things you can do wrong on the PHP side.
Additional questions:
error_log
? E.g. "Failed to initialize SASL library." or something like that?memcached.use_sasl = 1
in yourphp.ini
?I'm not an expert on Couchbase Server though I know my way around CouchDB. In case you have to debug it, I'd try to figure out how to crank up the log level to something like
DEBUG
and then see if you can gather any useful information.I think unless it's one of the first two things then this error is not on the PHP side but maybe in the Couchbase Server release. It looks like the write error is something libmemcached exposes so this means that it's coming from Couchbase Server directly.