"Unable to load dynamic library" Ubuntu 14.04 & PHP 5.5.9

I have CouchBase Server 4.5 up and running in my VM with the admin console available via port 8091. Now trying to setup the PHP SDK I get the following error message when just running a simple php -v from the command line:

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20121212/couchbase.so' - /usr/lib/php5/20121212/couchbase.so: undefined symbol: PCS_registerEmbedded in Unknown on line 0

I followed the directions from this page:


wget http://packages.couchbase.com/releases/couchbase-release/couchbase-release-1.0-2-amd64.deb
sudo dpkg -i couchbase-release-1.0-2-amd64.deb
sudo apt-get update
sudo apt-get install libcouchbase-dev build-essential php5-dev
sudo pecl install couchbase

Note that I had to install php5-dev rather than just “php-dev” as Ubuntu 14.04 has no package named php-dev. Perhaps this is the issue?

Ubuntu 14.04.5 LTS (GNU/Linux 4.4.0-31-generic x86_64)
PHP 5.5.9-1ubuntu4.20
CouchBase Server 4.5.0-2601 Community Edition (build-2601)

I have the couchbase.so module file in /usr/lib/php5/20121212 as expected and have symlinked the INI for loading it as such:

/usr/php5/cli/conf.d/99-couchbase.ini -> ../../mods-available/couchbase.ini

The couchbase.ini file looks like this:

; CouchBase SDK extension
; priority=99

Thank you in advance for any help you can provide.

A recent change was made to the PHP SDK to load the PHP stubs using the PCS extension. This requires that you install PCS before using the SDK, unfortunately it looks as though the documentation hasn’t not yet been updated to reflect this. You can install PCS via PECL:

$ sudo pecl install pcs-1.3.1

Additionally you should add PCS to your php.ini (Somewhere before couchbase.so)


Excellent. Thank you Will. I’m up and running now.