Search:

Search all manuals
Search this manual
Manual
Couchbase Client Library: PHP 1.1
Community Wiki and Resources
Wiki: PHP Client Library
PHP Client Library
Couchbase Developer Guide 2.0
Couchbase Server Manual 2.0
SDK Forum
Additional Resources
Community Wiki
Community Forums
Couchbase SDKs
Parent Section
1.1 Downloading and Installation
Chapter Sections
Chapters

1.1.1. Verifying the PHP SDK

To verify you have correctly set up the PHP SDK and the underlying C SDK follow these steps:

  1. Create a new file named test.php and place the following test code it:

    <?php
        $cb = new Couchbase("127.0.0.1:8091", "username", "password", "default");
        $cb->set("a", 101);
        var_dump($cb->get("a"));
    ?>
  2. Start your Couchbase Server. Note the ip address and port for Couchbase Server and any username and password.

  3. If you need to, update the IP address, username and password in test.php with your Couchbase Server information.

  4. Save the new script as test.php.

  5. Run your test script:

    shell> php test.php

    Couchbase Server returns 101.

Now you are ready to ready to develop with the PHP SDK and Couchbase Server 2.0. For more information about methods available in this SDK, see Couchbase Client Library: PHP 1.1. For learning more in general about developing application on Couchbase Server, see Couchbase Developer's Guide 2.0.