You should check which version of PHP that is in the repository:
# yum info php
If you need PHP 5.4 or 5.5 on CentOS 6, check out the linked webtatic guides!.
To install PHP, and the most common packages, just execute:
# yum install php php-common php-cli php-soap php-xml php-mysql
You should also install the PEAR extension, it will come in handy later
# yum install php-pear
- date.timezone - Set this value to "UTC" (without quote-marks). This will reduce the amount of raised warnings in the log.
- error_log - The path to the default PHP error log. If you don't explicitly set the error log path in the Web Application Apache Config (you should!), errors will end up in this log. PHP-errors from scheduled tasks, such as cronjobs, may end up in this log.
- short_open_tag - Do you plan to use "<?" as start of PHP-code? Set this parameter to "On"
- memory_limit - Have you got some batch processing job requiering insane amounts of memory? Tweak this value.
I only build REST-based services (unless a customer has an explicit SOAP-requirement), and my go-to library in PHP is Restler.
To get a working PHP client for Couchbase, you will need some tools to install custom software, and to build custom code:
# yum install gcc-c++ make automake php-devel
Next, you need a fresh copy of the Couchbase Library, fetch the latest C Libraries from the download site, and install them:
# wget http://packages.couchbase.com/clients/c/libcouchbase-2.4.9_centos62_x86_64.tar
# tar xvf libcouchbase-2.4.9_centos62_x86_64.tar
# cd libcouchbase-2.4.9_centos62_x86_64
# yum install *.rpm
Now you can install the PHP module for Couchbase, using PEAR/PECL (installed earlier)
# pecl install couchbase
Once installed, create a new PHP Loader File, so that the new Coúchbase module is loaded at run-time!
# vi /etc/php.d/zzz_couchbase.ini
; Load the Couchbase2 Module
Verify that the Couchbase module is loaded properly, by using the "info" (-i) switch of the PHP binary:
# php -i | grep couchbase
Version => 2.0.7
Now, you can test out some of the examples in the documentation.