php安装zookeeper扩展

1.安装zookeeper lib

下载zookeeper
wget http://mirror.bit.edu.cn/apache/zookeeper/zookeeper-3.4.11/zookeeper-3.4.11.tar.gz

解压缩
tar -xzf zookeeper-3.4.11.tar.gz

进入代码目录
cd zookeeper-3.4.11/src/c/

配置编译后的so的生成路径
./configure -prefix=/usr/local/zookeeper-lib/

编译
make && make install

2.安装php扩展

下载php-zookeeper
git clone https://github.com/andreiz/php-zookeeper.git
cd php-zookeeper
phpize

配置zookeeper-lib的路径和php的路径
./configure –with-libzookeeper-dir=/usr/local/zookeeper-lib/ –with-php-config=/usr/local/php/bin/php-config

编译
make && make install

3.改php配置文件

vim /usr/local/php/lib/php.ini

增加:

extension=zookeeper.so

ex.重启php
supervisorctl restart php-fpm

发表回复

您的电子邮箱地址不会被公开。