1、安装libzookeeper
tar -zxvf zookeeper-3.4.6.tar.gz
cd zookeeper-3.4.6/src/c
//zookeeper 有java与C版本, php拓展当然得安装C的源码咯。
./configure --prefix=/usr/local/zookeeper
make &make install
2、安装php zookeeper 拓展
tar -zxvf zookeeper-0.2.2.tgz
cd zookeeper-0.2.2
phpize
./configure --with-php-config=/usr/local/php/bin/php-config --with-lib-zookeeper-dir=/usr/local/zookeeper/
make & make install
* 如果出现报以下错误:
libtool: link: `php_zookeeper.lo' is not a valid libtool object
可以直接删掉php_zookeeper.lo
3、安装成功后配制:
Installing shared extensions: /usr/local/php-5.6.0/lib/php/extensions/no-debug-non-zts-20131226/
在php.ini 添加:
extension=zookeeper.so
重新加载fpm
kill -USR2 `cat /usr/local/nginx/logs/nginx.pid`
php -m 查看安装好的拓展