安装php-rdkafka 扩展
注意:git方式下载的话,需要先连接vpn
一、先安装librdkafka
>>>源码方式安装
git clone https://github.com/edenhill/librdkafka
librdkafka-master.zip
unzip librdkafka-master.zip
cd librdkafka-master
./configure make make install
>>>yum方式安装
yum install librdkafka-devel
yum install libtool
二、下载扩展包:
git clone https://github.com/arnaud-lb/php-rdkafka.git
php-rdkafka-5.x.zip
unzip php-rdkafka-5.x.zip
cd php-rdkafka-5.x
phpize
./configure (若是不写with-php-config,则用默认安装的PHP配置版本;若系统安装了多个版本PHP,必须指定with-php-config)
./configure --with-php-config=/usr/bin/php-config7.3/bin/php-config
make && make install
可能会报错,configure: error: Please reinstall the rdkafka distribution
说明没安装librdkafka
vim /etc/php.ini
exte