compared with
Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (49)

View Page History
Ideally it is recommended you install everything from the binary releases featured at

h3. Stable
libcouchbase: [http://www.couchbase.com/develop/c/current]

_libcouchbase: _http://www.couchbase.com/develop/c/current
php-ext-couchbase: [http://www.couchbase.com/develop/php/current]

_php-ext-couchbase:_ http://www.couchbase.com/develop/php/current
h2. Version Matrix

h3. Developer Preview
|| PHP Client \\ || Libcouchbase || Stable || Server Compatibility \\ || Supported Features \\ ||
_libcouchbase_: http://www.couchbase.com/develop/c/next

_php-ext-couchbase:_ http://www.couchbase.com/develop/php/next
|| PHP Version\\ || Libcouchbase Version || Stable || Server Compatibility\\ || Supported Features\\ ||
| 1.01.x | 12.0.x | Yes | 2.0, 1.8 | * Key-Value operations |
| 1.1-dp5 | 2.0.0beta2 | Developer\\
Preview | 2.0, 1.8 | * Key-Value operations
* MapReduce View Queries
* Lock, Touch |
| 1.0.x | 1.0.x | Maintenance | 2.0, 1.8 | * Key-Value operations |
| master branch | 2.0.0beta2 (or current \\
libcouchbase master) | Volatile | 2.0, 1.8 | Same as 1.1-dp5, 1.1.x, maybe some \\
other goodies |
| 1.0.x branch | 1.0.x | Yes (mostly) | 2.0, 1.8 | Same as 1.0.x release |

h4. Installing From Source

It is a common need to install for source (specifically, there is a lot of variation in the Zend API revisions)
h2. Techniques

*Recommended: *The first thing to do is install libcouchbase. If you are using a 1.8 server version OR are using a server of any version, but are not planning to employ views and MapReduce, you may use the *{_}stable{_}* version of libcouchbase (this is versioned as *{_}1.0.x{_}*).
h3. Connecting to a Live Server

*NOTE:* The stable php extension version is available in source form from the _1.0.x_ branch on github.
The 1.0.x PHP Couchbase Client Library does not currently use multiple URIs, but this can be easily worked around when setting up the connection. A future release will add support for multiple URIs.

If you wish to use the new and shiny features of Couchbase Server 2.0\[-beta\], then you need to use the *{_}Developer Preview (DP)_* versions of both libcouchbase and the php extension
{code}
$servers = array("http://server1:8091", "http://server2:8091");

_It is not required to build both libcouchbase and the php extension from source. As long as you have any version of libcouchbase installed (and its development headers, i.e. libcouchbase-dev or libcouchbase-devel)_ _it is possible to compile and build the PHP extension_
function my_couchbase_connect($servers) {
do {
if(empty($servers)) {
echo "no suitable server found";
return false;
// throw
}
$server = array_pop($servers);
$cb = couchbase_connect($server);
} while(!$cb);

return $cb;
}
{code}


h2. Installing From Source

It is a common need to install from source (there is a lot of variation in the Zend API revisions)

The first thing to do is install libcouchbase, the C client library for Couchbase, including development files.

_It is not required to build both libcouchbase and the php extension from source. As long as you have the matching version of libcouchbase installed (and its development headers, i.e. libcouchbase-dev or libcouchbase-devel) it is possible to compile and build the PHP extension._

Use the above version matrix to determine the version you need.

For php-ext-couchbase source installation, do the folllowing:

{code}
$ cd php-ext-couchbase


# If wishing to compile the stable branch of php-ext-couchbase, do the following
$ git checkout 1.0.x


$ phpize
$ ./configure
$ make install (or just copy modules/couchbase.so to your extension directory)
{code}

If libcouchbase is installed in a non-default path (for example, in your home directory) then you need to specify _\--with-couchbase=$dir_ to _./configure_, where $dir is the installation prefix; such that _$dir/include/libcouchbase/couchbase.h_ exists, and that _$dir/lib/libcouchbase.so_ (or _libcouchbase.dylib, for OS X_) exists

TBD

h1.
h2. Old Version 1.0.x

The 1.0.x PHP extension version is available in source form from the _1.0.x_ branch on github. This version is not recommended for current development, but is still available for existing applications which rely on it. Upgrading from 1.0.x to the current version requires very few, if any, code changes to the application.

h3. Binary packages

h2. Techniques
As outlined in the Version Matrix, the 1.0.x PHP extension needs the 1.x libcouchbase library. It will not work with libcouchbase 2.0.x. Binary packages for these older releases are available:

h3. Connecting to a Live Server
libcouchbase: [http://www.couchbase.com/develop/c/previous]

The 1.0.x PHP Couchbase Client Library does not currently use multiple URIs, but this can be easily worked around when setting up the connection. A future release will add support for multiple URIs.
php-ext-couchbase: [http://www.couchbase.com/develop/php/previous]

{code}
$servers = array("http://server1:8091", "http://server2:8091");
h3. Building from source

function my_couchbase_connect($servers) {
do {
if(empty($servers)) {
echo "no suitable server found";
return false;
// throw
}
$server = array_pop($servers);
$cb = couchbase_connect($server);
} while(!$cb);
After cloning the php-ext-couchbase repository from github, the 1.0.x branch can be checked out with:

return $cb;
$ git checkout 1.0.x
}
{code}
Follow the instructions for building from source as usual.