簡單記錄下安裝過程。php
1、安裝libzookeeperapache
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
libzookeeper編譯神奇的地方在於解壓完須要進入到src/c目錄,而不是常見軟件的解壓後第一級目錄。vim
2、安裝php zookeeper擴展bash
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
執行phpize有個問題,發現沒有configure文件,基於經驗。應該是沒有安裝automake.net
yum install automake
而後在執行phpize便可。code
3、修改php.ini配置,啓用zk擴展get
vim /usr/local/php/etc/php.ini 添加:extension=zookeeper.so 注意:先查找 extension_dir 是否已經配置過。php-config libzookeeper-dir路徑必定要正確