skip to Main Content

I installed PHP 7.4 and RdKafka by using PECL however the module didn’t start, here is the output of php -v

PHP Warning: PHP Startup: rdkafka: Unable to initialize module

Module compiled with module API=20210902

PHP compiled with module API=20190902

These options need to match

I assume that maybe my rdkafka module is to recent for this PHP binary, and I tried to install older version by doing ->

sudo pecl uninstall rdkafka && sudo pecl install rdkafka-4.0.0

According to pecl.php.net website, this version is the closest to my PHP binary compiled module ( https://pecl.php.net/package/rdkafka )

However there is an error while compiling the source code of this version.

make: *** [Makefile:205: rdkafka.lo] Error 1

I also tried several solutions proposed on various sources but I can not figure out how to make it work, and I havnt used PHP for like 10 years so my knowledge are very bad.

Anyone know how to fix or can give me some lead ?

2

Answers


  1. Chosen as BEST ANSWER

    I kind of solved the problem, instead of looking for a older version of this kafka module ( which does not compile on my system ), I tried with a newer version of PHP ( 8.1 ) and it run perfectly. Luckily for me it is compatible with my code base


  2. I am using xampp php version 7.4 on windows and got the same error .
    In my case commenting out the extension in php.ini for lib sodium did the trick.

    extension=php_sodium.dll
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search