php7安装kafka扩展
https://github.com/edenhill/librdkafka
./configure
make
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 自学吧