Couchbase
  • Why NoSQL?
  • Couchbase Server
  • Download
  • Resources
  • Careers
Home | Forums | Membase | Membase Server 1.6.x

How can PHP connect Membase via SASL on port 11211

5 replies [Last post]
  • Login or register to post comments
Thu, 06/02/2011 - 00:36
tomzzb
Offline
Joined: 05/29/2011
Groups: None

Hello everybody! I've set Membase listening on port 11211(SASL required) and now I can't no longer telnet it with error message "SERVER_ERROR unauthorized, null bucket" while I attempt to set a record.
Actually, I used to visit Memcached with PHP code as below:

$memcache = new Memcache;
$memcache->connect('192.168.37.230', 11211);

But now, I want to visit Membase which listens on 11211 which provides SASL authen. . Could anybody tell me how to write the PHP code with SASL? Thanks~!

Top
  • Login or register to post comments
Sun, 06/05/2011 - 23:11
perry
Offline
Joined: 10/11/2010
Groups:

Tom, some PHP memcache drivers support SASL while others do not. Can you tell me which specific driver you're using?

I believe the pecl-memcached one does support SASL, so it might be worth trying that out.

You also don't "have" to use SASL auth here. If you just set that bucket to live on a different point (11212 for example) you can setup your client to connect to it:
$memcache = new Memcache;
$memcache->connect('192.168.37.230', 11212);

You may also want to take a look at setting up a client-side Moxi process (http://www.couchbase.org/wiki/display/membase/Moxi) which can be very beneficial for a PHP deployment and also gives you some more flexibility on connecting to a specific bucket. For example, you can password protect the bucket from within the Membase cluster but then setup a client-side Moxi to provide a no-authentication connection.

Perry

__________________

Forum support is great for free but sometimes you need a guaranteed response time and dedicated resources for your questions or issues.
Consider purchasing enterprise-level support from Couchbase: http://www.couchbase.com/products-and-services/overview
Call or email "sales -at- couchbase-dot- com" today!

Top
  • Login or register to post comments
Mon, 06/06/2011 - 19:34
tomzzb
Offline
Joined: 05/29/2011
Groups: None

Thank you Perry for your quick responce!

I'm using pecl-memcached and I just don't know how I can use it to connect membase with SASL. I can't use the following instuctions any longer if the bucket set be of SASL.
$memcache = new Memcache;
$memcache->connect('192.168.37.230', 11211);

Could you kindly tell me how I write the instuctons with pecl-memcached to connected membase with SASL? Thanks~!

Top
  • Login or register to post comments
Thu, 06/09/2011 - 15:42
perry
Offline
Joined: 10/11/2010
Groups:

I'm still googling around a bit, apparently it's not so easy to find ;-)

I did find this post: http://pecl.php.net/bugs/bug.php?id=17149. At the bottom, he says he tested it with the NorthScale Memcached server which is the name of our product from last year so we know it's possible and in fact works the same way in the current Membase.

I'll post back if/when I find more specific examples but you might consider posting something to the pecl-memcached mailing list.

Perry

__________________

Forum support is great for free but sometimes you need a guaranteed response time and dedicated resources for your questions or issues.
Consider purchasing enterprise-level support from Couchbase: http://www.couchbase.com/products-and-services/overview
Call or email "sales -at- couchbase-dot- com" today!

Top
  • Login or register to post comments
Wed, 06/15/2011 - 00:27
tomzzb
Offline
Joined: 05/29/2011
Groups: None

Thank you, Perry!

Top
  • Login or register to post comments
Mon, 11/07/2011 - 19:40
ronnywang
Offline
Joined: 11/07/2011
Groups: None

I write a pure PHP Memcached class with SASL support in https://github.com/ronnywang/PHPMemcacheSASL
You can use this

Top
  • Login or register to post comments
  • Login or register to post comments
  • Login
  • Register

Company

  • About Us
  • Leadership
  • Customers
  • Partners
  • Contact Us

Product

  • Couchbase Server
  • Couchbase SDKs
  • Use Cases
  • Documentation
  • Forums

Open Source

  • Couchbase Project
  • Couchbase vs. CouchDB

Commercial

  • Subscriptions & Support
  • Training & Services

News

  • Blog
  • Newsletter
  • Press Releases
  • Buzz

Follow Us

    
  • Customer Login
  • Terms of Service
  • Privacy Policy
  • Trademark Policy
  • Site Map

© 2013 COUCHBASE All rights reserved.

Sign in to Couchbase Community

close
  • Create new account
  • Request new password
You are logging into the Forums, Wiki and Issue Tracker