Php-rdkafka: Call to undefined method RdKafka\Conf::setDefaultTopicConf() in master branch

Created on 19 Jun 2018  路  3Comments  路  Source: arnaud-lb/php-rdkafka

Building the Master branch gives this error:

FAIL RdKafka\Conf [tests/conf_callbacks.phpt]

And running the code in my laravel application give me this:

In PubSubConnectionFactory.php line 98:

Call to undefined method RdKafka\Conf::setDefaultTopicConf()

if I comment out that line I get this:

In PubSubServiceProvider.php line 76:

Class 'RdKafka\KafkaConsumer' not found

  • PHP version:
  • librdkafka version:
  • php-rdkfaka version:

Most helpful comment

Solved this issue myself using the following steps:

  1. Uninstall librakafka (sudo apt-get remove --auto-remove librdkafka-dev)
  2. Download the latest release (https://github.com/edenhill/librdkafka/releases)
  3. Unzip the librakafka, then ./configure; make; sudo make install
  4. Using this command:
    php -i | grep "extension_dir"
    Find the location of your php extensions and remove the rdkafka.so file.
  5. Now reinstall it using the manual method here: (https://arnaud-lb.github.io/php-rdkafka/phpdoc/rdkafka.installation.html)
  6. This should solve the issue as you will be recompiling rdkafka with the latest release of librakafka (make sure you do not use master for librakafka).

All 3 comments

Solved this issue myself using the following steps:

  1. Uninstall librakafka (sudo apt-get remove --auto-remove librdkafka-dev)
  2. Download the latest release (https://github.com/edenhill/librdkafka/releases)
  3. Unzip the librakafka, then ./configure; make; sudo make install
  4. Using this command:
    php -i | grep "extension_dir"
    Find the location of your php extensions and remove the rdkafka.so file.
  5. Now reinstall it using the manual method here: (https://arnaud-lb.github.io/php-rdkafka/phpdoc/rdkafka.installation.html)
  6. This should solve the issue as you will be recompiling rdkafka with the latest release of librakafka (make sure you do not use master for librakafka).

Solved this issue myself using the following steps:

  1. Uninstall librakafka (sudo apt-get remove --auto-remove librdkafka-dev)
  2. Download the latest release (https://github.com/edenhill/librdkafka/releases)
  3. Unzip the librakafka, then ./configure; make; sudo make install
  4. Using this command:
    php -i | grep "extension_dir"
    Find the location of your php extensions and remove the rdkafka.so file.
  5. Now reinstall it using the manual method here: (https://arnaud-lb.github.io/php-rdkafka/phpdoc/rdkafka.installation.html)
  6. This should solve the issue as you will be recompiling rdkafka with the latest release of librakafka (make sure you do not use master for librakafka).

thinks, i fixed by this method

Solved this issue myself using the following steps:

  1. Uninstall librakafka (sudo apt-get remove --auto-remove librdkafka-dev)
  2. Download the latest release (https://github.com/edenhill/librdkafka/releases)
  3. Unzip the librakafka, then ./configure; make; sudo make install
  4. Using this command:
    php -i | grep "extension_dir"
    Find the location of your php extensions and remove the rdkafka.so file.
  5. Now reinstall it using the manual method here: (https://arnaud-lb.github.io/php-rdkafka/phpdoc/rdkafka.installation.html)
  6. This should solve the issue as you will be recompiling rdkafka with the latest release of librakafka (make sure you do not use master for librakafka).

Thanks, it fixed for me too!

Was this page helpful?
0 / 5 - 0 ratings