Tuesday, April 2, 2013

Couchbase, PHP, XAMPP and Windows

A while ago I blogged about Couchbase, PHP and IIS, and earlier today I got a request for more information on how to do the same with XAMPP.

After I downloaded the installer and installed XAMPP in c:\xampp I downloaded one of my development builds of the php extension. Please note that this is a development build I've used for simple testing for myself, and I provide it AS IS WITHOUT ANY WARRANTIES so use it on your own risk (and not in production ;) ).

To "install" the extension, extract the zipfile and execute the following commands from within that directory:

copy php_couchbase.dll c:\xampp\php\ext
copy libcouchbase.dll c:\xampp\php
copy libcouchbase.dll c:\xampp\apache\bin

Use the XAMPP Control panel to edit the php.ini file, and enable the extension by adding:

[couchbase]
extension=php_couchbase.dll

(You may also change other tunables. See couchbase.ini for a full list).

(Re)start the Apache server from the XAMPP Control panel, and start writing code using the PHP extension. You'll find a description of the API in the file couchbase-api.php

Happy hacking!

8 comments:

  1. The bits about placement of libcouchbase.dll was just what I needed. Placed them into apache2/bin and zend/bin before zendserver admin would recognize and use the extension.

    ReplyDelete
  2. PHP is best and world popular programming language. Today all user want PHP web application development because it is easy to manage and so cheap also. It is fast to develop and user friendly also.

    ReplyDelete
  3. the ZIP file doesn't exists anymore. can you reupload it again? thanks.

    ReplyDelete
  4. tried this with wamp with no success. any ideas for wamp?

    ReplyDelete
  5. I am also facing problems in wamp. Please Help

    ReplyDelete
  6. Hi,

    I have followed your steps for php sdk setup for xampp but it is not working. Giving this error Class 'CouchbaseCluster' not found. Please help.

    ReplyDelete