一.安装librdkafka
git clone https://github.com/edenhill/librdkafka.git
cd librdkafka/
./configure
make
sudo make install //甚至不用这一步
cd /usr/local/lib/
sudo ln -sf librdkafka++.so.1 librdkafka++.so
二.安装扩展
git clone https://github.com/arnaud-lb/php-rdkafka.git
cd php-rdkafka
phpize
./configure --with-php-config=/usr/bin/php-config
make all -j 5
make test
sudo make install