Installed PHP RdKafka extension
Install PHP Rdkafka extension user default system on linux
On Debian and Ubuntu, install librdkafka from the Confluent APT repositories, see instructions here and then install librdkafka:
$ apt install librdkafka-dev
On RedHat, CentOS, Fedora, install librdkafka from the Confluent YUM repositories, instructions here and then install librdkafka:
$ yum install librdkafka-devel
For Linux Debian Stretch (9.13) actual flow is:
- Install PHP
peclandpearcommands:sudo apt install php-pearFYI: Depends on your installed PHP version you may need to use concrete version package. For example:
php7.2-pear. - (Skip if you already installed librdkafka-dev) Add backports repository. Current ext-rdkafka depends on
librdkafkaversion 0.11.0 or greater. So follow official instructions, but usestretch-backports. - (Skip if you already installed librdkafka-dev) Install
librdkafka-devpackage from backports:sudo apt -t stretch-backports install librdkafka-dev - Update apt:
sudo apt update - Install PECL-package:
sudo pecl install rdkafka - Enable PHP-extension in PHP config. Add to
php.ini:extension=rdkafka.soFYI: You need to restart
php-fpmservice to apply new config params.
Ref: https://github.com/edenhill/librdkafka?ref=morioh.com&utm_source=morioh.com#installation
Ref: https://stackoverflow.com/questions/47676416/how-do-i-install-an-extension-of-kafka-for-php
Tutorial:
- https://bestofphp.com/repo/arnaud-lb-php-rdkafka
- Install: https://arnaud-lb.github.io/php-rdkafka-doc/phpdoc/rdkafka.setup.html
- Example: https://arnaud-lb.github.io/php-rdkafka-doc/phpdoc/rdkafka.examples.html
- pecl: https://pecl.php.net/package/rdkafka
