php 安裝 zookeeper 擴展

php 安裝 zookeeper 擴展

 

下面是 PHP 生產、消費 Kafka 消息的例子(假設已經配置好 Kafka):

1.從 zookeeper 源碼 src/c/src 安裝 zookeeper c client

cd zookeeper-3.4.10/src/c
./configure
make && make install


或者 編譯 php libzookper 擴展


git clone https://github.com/Timandes/libzookeeper.git
cd libzookeeper
phpize
./configure --with-libzookeeper=/usr/local/bin/cli_mt
make && make install



編譯 php zookeeper 擴展

git clone https://github.com/php-zookeeper/php-zookeeper.git
cd php-zookeeper
phpize
./configure
make && make install



4.修改 php.ini 配置,添加 libzookeeper 和 php-zookeeper 擴展


vim /etc/php/7.0/cli/php.ini

extension=libzookeeper.so
extension=zookeeper.so



root@alex-virtual-machine:/usr/src/libzookeeper# /etc/init.d/php7.0-fpm restart

root@alex-virtual-machine:/usr/src/libzookeeper# service nginx restart

 

安裝php

http://mirror.bit.edu.cn/apache/zookeeper/zookeeper-3.4.8/zookeeper-3.4.8.tar.gz
/root/zookeeper-3.4.8/src/c
./configure -prefix=/usr/local/zookeeper/zookeeper-3.4.8/
php 擴展
./configure –with-php-config=/usr/bin/php-config -with-libzookeeper-dir=/usr/local/zookeeper/zookeeper-3.4.8/nginx

 

 

安裝 librdkafkagit

https://github.com/edenhill/librdkafkagithub

 

 
  1. ./configure
  2. make
  3. sudo make install

 

更多內容關注個人訂閱號apache

 

我的博客 www.zxb8.cc 自學吧vim

相關文章
相關標籤/搜索