php7安装kafka扩展

本文档提供了详细的步骤说明如何在PHP7环境下安装Kafka扩展。包括从源代码编译安装librdkafka库,配置与编译php-rdkafka扩展,并确保正确配置php.ini文件使扩展生效。

php7安装kafka扩展

 

https://github.com/edenhill/librdkafka

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

Requirements

The extension support both PHP 5 and PHP 7.

The extension requires » librdkafka >= 0.8 for basic functionality, and >= 0.9 for the high level consumer.

 

https://arnaud-lb.github.io/php-rdkafka/phpdoc/rdkafka.installation.manual.html

Manually Installing the extension

For extension developers and people interested in the latest bugfixes, you can compile the driver from the latest source code on » Github. Run the following commands to clone and build the project:

$ git clone https://github.com/arnaud-lb/php-rdkafka.git
$ cd php-rdkafka
$ phpize
$ ./configure
$ make all -j 5
$ sudo make install

The last step will report where rdkafka.so has been installed, similar to:

Installing shared extensions:     /usr/lib/php/extensions/debug-non-zts-20151012/

Ensure that the extension_dir option in php.ini points to the directory where rdkafka.so was installed. You can query the option by running:

$ php -i | grep extension_dir
  extension_dir => /usr/lib/php/extensions/debug-non-zts-20151012 =>
                   /usr/lib/php/extensions/debug-non-zts-20151012

If the directories differ, either change extension_dir in php.ini or manually move rdkafka.so to the correct directory.

Add the following line to your php.ini file:

extension=rdkafka.so

 

更多内容关注我的订阅号

 

个人博客 www.zxb8.cc 自学吧

转载于:https://my.oschina.net/yonghan/blog/1929514

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值