php安装zookeeper扩展

下面的.so是生成的,生成方法后面有些,这里就不上传附件了.

使用方法

  1. zookeeper.so复制到php扩展目录里面,如:/usr/lib64/php/modules/zookeeper.so
  2. /etc/php.ini结尾追加内容:
    1
    2
    [zookeeper]
    extension=zookeeper.so
  3. 重启php服务

说明

zookeeper.so库是根据zookeeper-3.4.10和php扩展zookeeper-0.4.0编译生成

追加自主编译流程说明

1
2
3
4
5
6
7
8
9
10
11
12
13
# 编译zookeeper生成so文件
tar -xzf zookeeper-3.4.9.tar.gz
cd zookeeper-3.4.9/src/c
./configure –prefix=/usr/local/zookeeper-lib/
make && make install

# 编译php-zookeeper生成so文件
tar xzf zookeeper-0.3.1.tgz
cd zookeeper-0.3.1
phpize
./configure -with-php-config=/usr/local/php7/bin/php-config -with-libzookeeper-dir=/usr/local/zookeeper-lib/
make
make install