一、安装libzookeeper
cd /usr/local/src/
wget http://mirror.bit.edu.cn/apache//zookeeper/zookeeper-3.4.5/zookeeper-3.4.5.tar.gz
tar -xf zookeeper-3.4.5.tar.gz
cd zookeeper-3.4.5/src/c
./configure –prefix=/usr/local/zookeeper/zookeeper-3.4.5/
make && make install
二、安装php zookeeper扩展
cd /usr/local/src/
wget ‘http://pecl.php.net/get/zookeeper-0.2.2.tgz’
tar zxvf zookeeper-0.2.2.tgz
cd zookeeper-0.2.2
phpize
./configure –with-php-config=/usr/local/php/bin/php-config  –with-libzookeeper-dir=/usr/local/zookeeper/zookeeper-3.4.5/
make && make install
vim /usr/local/php/etc/php.ini
查找:extension_dir=”/usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/”
添加:extension=zookeeper.so
三注意:php-config libzookeeper-di路径一定要正确
phpize是php为方便编译扩展用的命令,没有的需要安装