Why can't find RdKafka?

5.1k views Asked by At

I have a dockerfile:

FROM php:7.4.9-fpm
...............................
RUN apt-get install librdkafka-dev -y
RUN pecl install rdkafka \
    && docker-php-ext-enable rdkafka

After docker-compose build and up -d, exec container php, make php -m and I saw rdkafka in module list.

Similary in composer.json added and installed:

"require": {
        "php": "^7.2.5",
        "ext-rdkafka": "*",

In this project I used php framework Lumen.
The question: when I'm trying in any class to put $conf = new RdKafka\Conf(); - every time I got an error: Undefined class 'Conf'

Why?

1

There are 1 answers

2
Fitstd On BEST ANSWER

You need to install ext-rdkafka.