Reputation: 147
This is the extension that I am trying to install: https://github.com/EVODelavega/phpkafka
The messages passed to the queue should be in JSON format.
Currently, I am getting installation errors: 1. The instructions ask me to install librdkafka. 2. The installation link for the above step is this. I am unable to install using the 1st and 4th method. This is the error:
checking for librdkafka/rdkafka.h" in default path... not found
configure: error: Please reinstall the rdkafka distribution
Upvotes: 7
Views: 36377
Reputation: 881
I'm using Manjaro OS and I did that steps:
https://arnaud.le-blanc.net/php-rdkafka-doc/phpdoc/rdkafka.installation.html
$ git clone https://github.com/arnaud-lb/php-rdkafka.git
$ cd php-rdkafka
$ phpize
$ ./configure
$ make all -j 5
$ sudo make install
And then in my php.ini (in /etc/php/php.ini) I added next line:
extension=rdkafka.so
And that everything just works fine.
Upvotes: 0
Reputation: 2964
Quick Install Steps:
Step 1 Install PHP pecl and pear commands:
sudo apt install php-pear
Step 2 Install librdkafka
sudo apt-get install -y librdkafka-dev
Step 3 Install PECL-package
sudo pecl install rdkafka
Step4 Enable PHP-extension in PHP config. Add to php.ini
sudo nano /etc/php/7.4/cli/php.ini
extension=rdkafka.so
Step 4 Restart apache server
sudo service apache2 restart
Upvotes: 16
Reputation: 14531
For Linux Debian Stretch (9.13) actual flow is:
Install PHP pecl
and pear
commands:
sudo apt install php-pear
FYI: Depends on your installed PHP version you may need to use concrete version package. For example:
php7.2-pear
.
Add backports repository. Current ext-rdkafka depends on librdkafka
version 0.11.0 or greater. So follow official instructions, but use stretch-backports
.
Install librdkafka-dev
package 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.so
FYI: You need to restart
php-fpm
service to apply new config params.
Upvotes: 5
Reputation: 61
because you need another package librdkafka,you should install librdkafka first
this way can resolve your problem
Upvotes: 6