php 7 安装kafka扩展

http://www.cnblogs.com/darrenzzy/p/9355210.html

1. 查看php是否有kafka扩展,在命令行中输入 php -m | grep kafka,  看是否有rdkafka 

2.安装librdkafka

# git clone https://github.com/edenhill/librdkafka.git

# cd librdkafka

# ./configure

# make

# make install

# ln -s /usr/local/lib/librdkafka.so.1 /usr/lib/

3.

# git clone https://github.com/arnaud-lb/php-rdkafka.git

# cd php-rdkafka

# phpize

# ./configure 

# make all -j 5

# make install

4.
vi /etc/php.d/kafka.ini

加入 

; Enable kafka extension module

extension=rdkafka.so

5 systemctl reload php-fpm

你可能感兴趣的:(php 7 安装kafka扩展)