一、安装librdkafka
# cd /usr/local/src/ # git clone https://github.com/edenhill/librdkafka.git # cd librdkafka # ./configure # make # make install # ln -s /usr/local/lib/librdkafka.so.1 /usr/lib/
二、安装php-rdkafka
# cd /usr/local/src/ # git clone https://github.com/arnaud-lb/php-rdkafka.git # cd php-rdkafka # /usr/local/php/bin/phpize # ./configure --with-php-config=/usr/local/php/bin/php-config # make all -j 5 # make install
三、修改php.ini
# vi /etc/php.ini
##增加如下代码:##
extension=rdkafka.so
##查看是否安装成功:##
# /usr/local/php/bin/php -m
四、重启php-fpm
# service php-fpm restart
推荐学习:php视频教程
以上就是php7如何安装kafka扩展的详细内容,
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)