Install Zookeeper PHP Extension

The following tutorial will install the Zookeeper extension for PHP and has been tested on Ubuntu 14.04 and Debian 8.


Firstly, we need to manually install Zookeeper. You can go here to grab the latest version/link, which at the time of writing this tutorial is 3.4.8. This will result in us having the headers which prevented us from being able to use other solutions to install the extension.

sudo apt-get install php5-dev -y
tar --extract --gzip --file zookeep*
cd zookeeper-*
cd src/c
./configure --prefix=/usr/
sudo make install

Now that we have zookeeper installed, we can compile the php extension.

cd $HOME
sudo apt-get install git -y
git clone
cd php-zookeeper
sudo make install

We've compiled the PHP extension, now we just need to add it to PHP by executing the following command:

sudo echo "" | \
sudo tee -a /etc/php5/cli/conf.d/20-zookeeper.ini

That's it! Run the following command to check that everything installed correctly:

php -m | grep zookeeper

You should see the following output:





Stuart is a software developer with a passion for Linux and open source projects.

comments powered by Disqus
We are a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for us to earn fees by linking to and affiliated sites. More info.