PHP安装kafka插件

在工作中我们经常遇到需要给php安装插件,今天把php安装kafka的插件的步骤整理下,仅供大家参考

1:需要先安装librdkafka

git clone https://github.com/edenhill/librdkafka.git
./configure --prefix=/usr/local/product/librdkafka
make
make install
ln -s /usr/local/product/librdkafka/lib/lib* /usr/local/lib
ln -s /usr/local/product/librdkafka/include/librdkafka /usr/local/include

2:安装rdkafka插件
git clone https://github.com/arnaud-lb/php-rdkafka.git
cd php-rdkafka
phpize
./configure --help | grep rdkafka
./configure --with-rdkafka --with-php-config=/usr/local/php/bin/php-config
make
make install

3:在php.ini配置中添加你新增的插件

4:php -m就可以看到你安装的插件了

上一篇:办理渥太华大学(本科)学历认证『微信171922772』Ottawa U学位证成绩单使馆认证University of Ottawa


下一篇:在ASP.NET MVC项目中使用React