2

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?

Fitstd
  • 189
  • 2
  • 9

1 Answers1

1

You need to install ext-rdkafka.

Fitstd
  • 189
  • 2
  • 9
  • 2
    Care to elaborate a bit? I am running `docker-php-ext-install rdkafka` and am still getting `error: /usr/src/php/ext/rdkafka does not exist` – Prof Jul 30 '21 at 08:28
  • 1
    @Prof you need to install the `librdkafka`. Please check the Readme file https://github.com/edenhill/librdkafka – volkan Dec 08 '21 at 09:53