Linux给php安装Kafka扩展
- 安装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 /usr/lib/
-
安装php-rdkafka
cd /usr/local/src/ git clone https://github.com/arnaud-lb/php-rdkafka.git cd php-rdkafka //首先查看phpize的位置 find / -name phpize /www/server/php/74/bin/phpize //再查看并编译一下php的配置信息 ./configure --with-php-config=/usr/local/php/bin/php-config make && make install
-
修改php.ini ( 先查看当前的php配置文件的位置 find / -name php.ini )
/www/backup/file_history/www/server/php/74/etc/php.ini
vim /www/backup/file_history/www/server/php/74/etc/php.ini 增加如下代码: extension=rdkafka.so 或者 echo 'extension=rdkafka.so' >> /www/backup/file_history/www/server/php/74/etc/php.ini
-
查看php的扩展是否安装成功
执行php -m
安装完成✅
本文来自博客园,作者:LiJialong,转载请注明原文链接:https://www.cnblogs.com/carver/articles/17674066.html