http://pecl.php.net/package/zookeeper
一、安装libzookeeper
1. cd /usr/local/zookeeper/zookeeper-3.4.3/src/c
2. sudo ./configure --prefix=/usr/local/zookeeper/zookeeper-3.4.3/
3. sudo make
4. sudo make install
二、安装php zookeeper扩展
1. wget 'https://nodeload.github.com/andreiz/php-zookeeper/zipball/master'
2. unzip andreiz-php-zookeeper-v0.2.1-12-g37e6ed9.zip
3. cd andreiz-php-zookeeper-37e6ed9/
4.phpize
5../configure --with-php-config=/usr/local/php/bin/php-config --with-libzookeeper-dir=/usr/local/zookeeper/zookeeper-3.4.3/
6.make
7.sudo make install
8. sudo vim /usr/local/php/etc/php.ini
extension_dir="/usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/"
extension=zookeeper.so
三、测试
1.zkServer.sh start
2.php examples/Zookeeper_Example.php
由于zookeeper启动比较慢,可能会报报连接错误,等一分钟左右再次执行就OK了
四、注意
如果安装中报错error: ‘zend_class_entry’ has no member named ‘default_properties’
修改为default_properties_table