Table of Contents
We will use PHP and access the Couchbase server as part of this exercise; the Couchbase Server can be part of a cluster or it can be stand-alone. This exercise will show you how to:
Download, install and configure the Couchbase PHP SDK
How to use Couchbase and PHP to generate a general page access counter and last-accessed date indicator script
This section assumes that you have the following items set up for your development environment:
PHP 5 and above installed. For more information, see PHP Manual,
Web server installed and configured to serve PHP pages,
Couchbase Server 1.8 or above installed, and available from your development environment. See Couchbase Downloads
This section also assumes you have downloaded and set up a compatible version of Couchbase Server and have at least one instance of Couchbase Server and one data bucket established. If you need to set up these items, you can do with the Couchbase Administrative Console, or Couchbase Command-Line Interface (CLI), or the Couchbase REST-API. For information and instructions, see:
Using the Couchbase Web Console, for information on using the Couchbase Administrative Console,
Couchbase CLI, for the command line interface,
Couchbase REST API, for creating and managing Couchbase resources.
The TCP/IP port allocation on Windows by default includes a restricted number of ports available for client communication. For more information on this issue, including information on how to adjust the configuration and increase the available ports, see MSDN: Avoiding TCP/IP Port Exhaustion.
After you have your Couchbase Server set up and you have installed the Couchbase SDK, you can compile and run the following basic program.