These are chat archives for arnaud-lb/php-rdkafka

28th
Apr 2016
Kushal Halder
@kushalhalder
Apr 28 2016 11:22
Hi guys, I compiled the library on my ubuntu system but whenever I start php, I get this PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20121212/rdkafka.so' - /usr/lib/php5/20121212/rdkafka.so: undefined symbol: rd_kafka_queue_new in Unknown on line 0
@arnaud-lb ^
Arnaud Le Blanc
@arnaud-lb
Apr 28 2016 11:23
Hi @kushalhalder, I looks like the system can not find librdkafka.so
what’s the output of ldd /usr/lib/php5/20121212/rdkafka.so ?
Kushal Halder
@kushalhalder
Apr 28 2016 11:23
ok.. .that is installed too :/
one sec
ubuntu@ip-172-31-9-68:~$ ldd /usr/lib/php5/20121212/rdkafka.so
linux-vdso.so.1 => (0x00007ffff17f6000)
librdkafka.so.1 => /usr/lib/librdkafka.so.1 (0x00007f9a1c1e1000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f9a1be1c000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f9a1bbfd000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f9a1b9f5000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f9a1b7dc000)
/lib64/ld-linux-x86-64.so.2 (0x00007f9a1c621000)
is it renamed or something to .1?
Arnaud Le Blanc
@arnaud-lb
Apr 28 2016 11:26
Which version of librdkafka is this ? What’s the output of nm /usr/lib/librdkafka.so.1|grep rd_kafka_queue_new ?
Kushal Halder
@kushalhalder
Apr 28 2016 11:27
I compiled it from master
$ nm /usr/lib/librdkafka.so.1|grep rd_kafka_queue_new
nm: /usr/lib/librdkafka.so.1: no symbols
Arnaud Le Blanc
@arnaud-lb
Apr 28 2016 11:28
weird
could you try removing /usr/lib/librdkafka.so* and installing it again ? (make install)
Kushal Halder
@kushalhalder
Apr 28 2016 11:28
sure
give me sometime
did that... i guess i have to install rdkafka again?
Arnaud Le Blanc
@arnaud-lb
Apr 28 2016 11:33
not necessarily, but it wouldn’t hurt :)
Kushal Halder
@kushalhalder
Apr 28 2016 11:33
cuz of this
ldd /usr/lib/php5/20121212/rdkafka.so
linux-vdso.so.1 => (0x00007fff663a5000)
librdkafka.so.1 => not found
Arnaud Le Blanc
@arnaud-lb
Apr 28 2016 11:33
try running ldconfig
Kushal Halder
@kushalhalder
Apr 28 2016 11:33
:D
hmmm
it worked
Arnaud Le Blanc
@arnaud-lb
Apr 28 2016 11:34
awesome :)
Kushal Halder
@kushalhalder
Apr 28 2016 11:34
ldd /usr/lib/php5/20121212/rdkafka.so
linux-vdso.so.1 => (0x00007fff57ba1000)
librdkafka.so.1 => /usr/local/lib/librdkafka.so.1 (0x00007fe6ef593000)
any idea what the issue was?
Arnaud Le Blanc
@arnaud-lb
Apr 28 2016 11:36
it looks like the librdkafka installation was broken - the librdkafa.so.1 didn’t have any symbol in it, which is not normal
Kushal Halder
@kushalhalder
Apr 28 2016 11:36
hmmm
thanks though :D
Arnaud Le Blanc
@arnaud-lb
Apr 28 2016 11:39
you’re welcome :)
Kushal Halder
@kushalhalder
Apr 28 2016 12:26
@arnaud-lb so now, your library make is failing
checking for librdkafka/rdkafka.h" in default path... found in /usr/local
found in /usr
checking for rd_kafka_new in -lrdkafka... no
configure: error: wrong rdkafka lib version or lib not found
Arnaud Le Blanc
@arnaud-lb
Apr 28 2016 12:28
could you try with ./configure --with-rdkafka=/usr/local ?
Kushal Halder
@kushalhalder
Apr 28 2016 12:29
worked :)
Arnaud Le Blanc
@arnaud-lb
Apr 28 2016 12:30
:)
Kushal Halder
@kushalhalder
Apr 28 2016 12:32

now

$ php -m | grep kafka
rdkafka

but I still get this PHP Fatal error: Class 'RdKafka\KafkaConsumer' not found

i did get this issue once before but it was solved when i manually compiled it from the repo
Kushal Halder
@kushalhalder
Apr 28 2016 12:39
@arnaud-lb here:
$ php -a
Interactive mode enabled

php > $consumer =  new \RdKafka\KafkaConsumer();
PHP Fatal error:  Class 'RdKafka\KafkaConsumer' not found in php shell code on line 1
PHP Stack trace:
PHP   1. {main}() php shell code:0
php >
Kushal Halder
@kushalhalder
Apr 28 2016 12:49
this is similar to issue #39
Where as this works
$ php -a
Interactive mode enabled

php > $consumer =  new \RdKafka\Consumer();
php >
Arnaud Le Blanc
@arnaud-lb
Apr 28 2016 13:00
It seems that you have ./configure’d php-rdkafka against librdkafka 0.8. Try cleaning php-rdkafka (git clean -dfx, or download it again) and building it again with --with-rdkafka=/usr/local
Kushal Halder
@kushalhalder
Apr 28 2016 14:09
yeah... that worked