Unable to Install on AMI Linux 2
Drivible opened this issue · 6 comments
Details:
- PHP version: 7.4
- librdkafka version: v2.1.1 (Latest version from source)
- simple-kafka-client version: Release v0.1.4 and Latest master branch version from source.. But the issue is I can't run it, pecl or source
- kafka version: 3.8 (latest version MSK supports)
I had a whole lot of issues trying to install the simple-kafka-client, having to install librdkafka from source.
Then whilst the PHP extension simple_kafka_client installed OK on my Ubuntu machine, it failed on AMI Linux 2.
To be specific, it make and make installed fine, but PHP would error saying "undefined symbol: rd_kafka_error_is_retriable" and wouldn't run the library.
More details:
https://www.kublermdk.com/2023/05/19/installing-php-simple-kafka-lib-librdkafka-version-issues/
I wanted to let you know that I've had a whole lot of issues just trying to set this up.
I don't think I'd be the only person trying PHP and Kafka, but it seems like there aren't many of us.
Steps to replicate:
- Setup an Amazon EC2 server running AMI Linux 2 (e.g via Elastic Beanstalk)
- Install PHP v7.4
- Install librdkafka from source
- Install the simple-kafka-client via pecl or source
- Run PHP (e.g php -v) from the command line
- There's an error undefined symbol: rd_kafka_error_is_retriable
The full configure and make output.
Note that I had already tried installing different versions of gcc and g++ by this point so it might be a little different from the base setup, although that didn't work either.
root@staging:/var/app/current# git clone https://github.com/php-kafka/php-simple-kafka-client.git
Cloning into 'php-simple-kafka-client'...
remote: Enumerating objects: 588, done.
remote: Counting objects: 100% (213/213), done.
remote: Compressing objects: 100% (92/92), done.
remote: Total 588 (delta 169), reused 129 (delta 121), pack-reused 375
Receiving objects: 100% (588/588), 181.00 KiB | 6.70 MiB/s, done.
Resolving deltas: 100% (399/399), done.
root@staging:/var/app/current# cd php-simple-kafka-client
root@staging:/var/app/current/php-simple-kafka-client# phpize && ./configure && make -j5 all && make install
Configuring for:
PHP Api Version: 20190902
Zend Module Api No: 20190902
Zend Extension Api No: 320190902
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking for pkg-config... /bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib
checking for PHP extension directory... /usr/lib64/php/modules
checking for PHP installed headers prefix... /usr/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for gawk... gawk
checking for kafka client support... yes, shared
checking for librdkafka/rdkafka.h" in default path... found in /usr/local
found in /usr
checking for rd_kafka_new in -lrdkafka... yes
checking for librdkafka version... >= 1.6.0
checking how to print strings... printf
checking for a sed that does not truncate output... (cached) /bin/sed
checking for fgrep... /bin/grep -F
checking for ld used by cc... /bin/ld
checking if the linker (/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /bin/nm -B
checking the name lister (/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking for gawk... (cached) gawk
checking command to parse /bin/nm -B output from cc object... ok
checking for sysroot... no
checking for mt... no
checking if : is a manifest tool... no
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC -DPIC
checking if cc PIC flag -fPIC -DPIC works... yes
checking if cc static flag -static works... no
checking if cc supports -c -o file.o... yes
checking if cc supports -c -o file.o... (cached) yes
checking whether the cc linker (/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
configure: patching config.h.in
configure: creating ./config.status
config.status: creating config.h
config.status: executing libtool commands
/bin/sh /var/app/current/php-simple-kafka-client/libtool --mode=compile cc -I. -I/var/app/current/php-simple-kafka-client -DPHP_ATOM_INC -I/var/app/current/php-simple-kafka-client/include -I/var/app/current/php-simple-kafka-client/main -I/var/app/current/php-simple-kafka-client -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /var/app/current/php-simple-kafka-client/simple_kafka_client.c -o simple_kafka_client.lo
/bin/sh /var/app/current/php-simple-kafka-client/libtool --mode=compile cc -I. -I/var/app/current/php-simple-kafka-client -DPHP_ATOM_INC -I/var/app/current/php-simple-kafka-client/include -I/var/app/current/php-simple-kafka-client/main -I/var/app/current/php-simple-kafka-client -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /var/app/current/php-simple-kafka-client/producer.c -o producer.lo
/bin/sh /var/app/current/php-simple-kafka-client/libtool --mode=compile cc -I. -I/var/app/current/php-simple-kafka-client -DPHP_ATOM_INC -I/var/app/current/php-simple-kafka-client/include -I/var/app/current/php-simple-kafka-client/main -I/var/app/current/php-simple-kafka-client -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /var/app/current/php-simple-kafka-client/metadata.c -o metadata.lo
/bin/sh /var/app/current/php-simple-kafka-client/libtool --mode=compile cc -I. -I/var/app/current/php-simple-kafka-client -DPHP_ATOM_INC -I/var/app/current/php-simple-kafka-client/include -I/var/app/current/php-simple-kafka-client/main -I/var/app/current/php-simple-kafka-client -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /var/app/current/php-simple-kafka-client/metadata_broker.c -o metadata_broker.lo
/bin/sh /var/app/current/php-simple-kafka-client/libtool --mode=compile cc -I. -I/var/app/current/php-simple-kafka-client -DPHP_ATOM_INC -I/var/app/current/php-simple-kafka-client/include -I/var/app/current/php-simple-kafka-client/main -I/var/app/current/php-simple-kafka-client -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /var/app/current/php-simple-kafka-client/metadata_topic.c -o metadata_topic.lo
libtool: compile: cc -I. -I/var/app/current/php-simple-kafka-client -DPHP_ATOM_INC -I/var/app/current/php-simple-kafka-client/include -I/var/app/current/php-simple-kafka-client/main -I/var/app/current/php-simple-kafka-client -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /var/app/current/php-simple-kafka-client/producer.c -fPIC -DPIC -o .libs/producer.o
libtool: compile: cc -I. -I/var/app/current/php-simple-kafka-client -DPHP_ATOM_INC -I/var/app/current/php-simple-kafka-client/include -I/var/app/current/php-simple-kafka-client/main -I/var/app/current/php-simple-kafka-client -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /var/app/current/php-simple-kafka-client/simple_kafka_client.c -fPIC -DPIC -o .libs/simple_kafka_client.o
libtool: compile: cc -I. -I/var/app/current/php-simple-kafka-client -DPHP_ATOM_INC -I/var/app/current/php-simple-kafka-client/include -I/var/app/current/php-simple-kafka-client/main -I/var/app/current/php-simple-kafka-client -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /var/app/current/php-simple-kafka-client/metadata.c -fPIC -DPIC -o .libs/metadata.o
libtool: compile: cc -I. -I/var/app/current/php-simple-kafka-client -DPHP_ATOM_INC -I/var/app/current/php-simple-kafka-client/include -I/var/app/current/php-simple-kafka-client/main -I/var/app/current/php-simple-kafka-client -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /var/app/current/php-simple-kafka-client/metadata_broker.c -fPIC -DPIC -o .libs/metadata_broker.o
libtool: compile: cc -I. -I/var/app/current/php-simple-kafka-client -DPHP_ATOM_INC -I/var/app/current/php-simple-kafka-client/include -I/var/app/current/php-simple-kafka-client/main -I/var/app/current/php-simple-kafka-client -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /var/app/current/php-simple-kafka-client/metadata_topic.c -fPIC -DPIC -o .libs/metadata_topic.o
/bin/sh /var/app/current/php-simple-kafka-client/libtool --mode=compile cc -I. -I/var/app/current/php-simple-kafka-client -DPHP_ATOM_INC -I/var/app/current/php-simple-kafka-client/include -I/var/app/current/php-simple-kafka-client/main -I/var/app/current/php-simple-kafka-client -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /var/app/current/php-simple-kafka-client/metadata_partition.c -o metadata_partition.lo
/bin/sh /var/app/current/php-simple-kafka-client/libtool --mode=compile cc -I. -I/var/app/current/php-simple-kafka-client -DPHP_ATOM_INC -I/var/app/current/php-simple-kafka-client/include -I/var/app/current/php-simple-kafka-client/main -I/var/app/current/php-simple-kafka-client -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /var/app/current/php-simple-kafka-client/metadata_collection.c -o metadata_collection.lo
/bin/sh /var/app/current/php-simple-kafka-client/libtool --mode=compile cc -I. -I/var/app/current/php-simple-kafka-client -DPHP_ATOM_INC -I/var/app/current/php-simple-kafka-client/include -I/var/app/current/php-simple-kafka-client/main -I/var/app/current/php-simple-kafka-client -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /var/app/current/php-simple-kafka-client/configuration.c -o configuration.lo
/bin/sh /var/app/current/php-simple-kafka-client/libtool --mode=compile cc -I. -I/var/app/current/php-simple-kafka-client -DPHP_ATOM_INC -I/var/app/current/php-simple-kafka-client/include -I/var/app/current/php-simple-kafka-client/main -I/var/app/current/php-simple-kafka-client -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /var/app/current/php-simple-kafka-client/topic.c -o topic.lo
libtool: compile: cc -I. -I/var/app/current/php-simple-kafka-client -DPHP_ATOM_INC -I/var/app/current/php-simple-kafka-client/include -I/var/app/current/php-simple-kafka-client/main -I/var/app/current/php-simple-kafka-client -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /var/app/current/php-simple-kafka-client/metadata_partition.c -fPIC -DPIC -o .libs/metadata_partition.o
libtool: compile: cc -I. -I/var/app/current/php-simple-kafka-client -DPHP_ATOM_INC -I/var/app/current/php-simple-kafka-client/include -I/var/app/current/php-simple-kafka-client/main -I/var/app/current/php-simple-kafka-client -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /var/app/current/php-simple-kafka-client/metadata_collection.c -fPIC -DPIC -o .libs/metadata_collection.o
libtool: compile: cc -I. -I/var/app/current/php-simple-kafka-client -DPHP_ATOM_INC -I/var/app/current/php-simple-kafka-client/include -I/var/app/current/php-simple-kafka-client/main -I/var/app/current/php-simple-kafka-client -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /var/app/current/php-simple-kafka-client/configuration.c -fPIC -DPIC -o .libs/configuration.o
libtool: compile: cc -I. -I/var/app/current/php-simple-kafka-client -DPHP_ATOM_INC -I/var/app/current/php-simple-kafka-client/include -I/var/app/current/php-simple-kafka-client/main -I/var/app/current/php-simple-kafka-client -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /var/app/current/php-simple-kafka-client/topic.c -fPIC -DPIC -o .libs/topic.o
/bin/sh /var/app/current/php-simple-kafka-client/libtool --mode=compile cc -I. -I/var/app/current/php-simple-kafka-client -DPHP_ATOM_INC -I/var/app/current/php-simple-kafka-client/include -I/var/app/current/php-simple-kafka-client/main -I/var/app/current/php-simple-kafka-client -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /var/app/current/php-simple-kafka-client/message.c -o message.lo
libtool: compile: cc -I. -I/var/app/current/php-simple-kafka-client -DPHP_ATOM_INC -I/var/app/current/php-simple-kafka-client/include -I/var/app/current/php-simple-kafka-client/main -I/var/app/current/php-simple-kafka-client -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /var/app/current/php-simple-kafka-client/message.c -fPIC -DPIC -o .libs/message.o
/bin/sh /var/app/current/php-simple-kafka-client/libtool --mode=compile cc -I. -I/var/app/current/php-simple-kafka-client -DPHP_ATOM_INC -I/var/app/current/php-simple-kafka-client/include -I/var/app/current/php-simple-kafka-client/main -I/var/app/current/php-simple-kafka-client -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /var/app/current/php-simple-kafka-client/functions.c -o functions.lo
libtool: compile: cc -I. -I/var/app/current/php-simple-kafka-client -DPHP_ATOM_INC -I/var/app/current/php-simple-kafka-client/include -I/var/app/current/php-simple-kafka-client/main -I/var/app/current/php-simple-kafka-client -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /var/app/current/php-simple-kafka-client/functions.c -fPIC -DPIC -o .libs/functions.o
/bin/sh /var/app/current/php-simple-kafka-client/libtool --mode=compile cc -I. -I/var/app/current/php-simple-kafka-client -DPHP_ATOM_INC -I/var/app/current/php-simple-kafka-client/include -I/var/app/current/php-simple-kafka-client/main -I/var/app/current/php-simple-kafka-client -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /var/app/current/php-simple-kafka-client/consumer.c -o consumer.lo
libtool: compile: cc -I. -I/var/app/current/php-simple-kafka-client -DPHP_ATOM_INC -I/var/app/current/php-simple-kafka-client/include -I/var/app/current/php-simple-kafka-client/main -I/var/app/current/php-simple-kafka-client -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /var/app/current/php-simple-kafka-client/consumer.c -fPIC -DPIC -o .libs/consumer.o
/bin/sh /var/app/current/php-simple-kafka-client/libtool --mode=compile cc -I. -I/var/app/current/php-simple-kafka-client -DPHP_ATOM_INC -I/var/app/current/php-simple-kafka-client/include -I/var/app/current/php-simple-kafka-client/main -I/var/app/current/php-simple-kafka-client -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /var/app/current/php-simple-kafka-client/topic_partition.c -o topic_partition.lo
/bin/sh /var/app/current/php-simple-kafka-client/libtool --mode=compile cc -I. -I/var/app/current/php-simple-kafka-client -DPHP_ATOM_INC -I/var/app/current/php-simple-kafka-client/include -I/var/app/current/php-simple-kafka-client/main -I/var/app/current/php-simple-kafka-client -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /var/app/current/php-simple-kafka-client/kafka_exception.c -o kafka_exception.lo
libtool: compile: cc -I. -I/var/app/current/php-simple-kafka-client -DPHP_ATOM_INC -I/var/app/current/php-simple-kafka-client/include -I/var/app/current/php-simple-kafka-client/main -I/var/app/current/php-simple-kafka-client -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /var/app/current/php-simple-kafka-client/topic_partition.c -fPIC -DPIC -o .libs/topic_partition.o
libtool: compile: cc -I. -I/var/app/current/php-simple-kafka-client -DPHP_ATOM_INC -I/var/app/current/php-simple-kafka-client/include -I/var/app/current/php-simple-kafka-client/main -I/var/app/current/php-simple-kafka-client -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /var/app/current/php-simple-kafka-client/kafka_exception.c -fPIC -DPIC -o .libs/kafka_exception.o
/bin/sh /var/app/current/php-simple-kafka-client/libtool --mode=link cc -DPHP_ATOM_INC -I/var/app/current/php-simple-kafka-client/include -I/var/app/current/php-simple-kafka-client/main -I/var/app/current/php-simple-kafka-client -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -o simple_kafka_client.la -export-dynamic -avoid-version -prefer-pic -module -rpath /var/app/current/php-simple-kafka-client/modules simple_kafka_client.lo producer.lo metadata.lo metadata_broker.lo metadata_topic.lo metadata_partition.lo metadata_collection.lo configuration.lo topic.lo message.lo functions.lo consumer.lo topic_partition.lo kafka_exception.lo -lrdkafka
libtool: link: cc -shared -fPIC -DPIC .libs/simple_kafka_client.o .libs/producer.o .libs/metadata.o .libs/metadata_broker.o .libs/metadata_topic.o .libs/metadata_partition.o .libs/metadata_collection.o .libs/configuration.o .libs/topic.o .libs/message.o .libs/functions.o .libs/consumer.o .libs/topic_partition.o .libs/kafka_exception.o -lrdkafka -O2 -Wl,-soname -Wl,simple_kafka_client.so -o .libs/simple_kafka_client.so
libtool: link: ( cd ".libs" && rm -f "simple_kafka_client.la" && ln -s "../simple_kafka_client.la" "simple_kafka_client.la" )
/bin/sh /var/app/current/php-simple-kafka-client/libtool --mode=install cp ./simple_kafka_client.la /var/app/current/php-simple-kafka-client/modules
libtool: install: cp ./.libs/simple_kafka_client.so /var/app/current/php-simple-kafka-client/modules/simple_kafka_client.so
libtool: install: cp ./.libs/simple_kafka_client.lai /var/app/current/php-simple-kafka-client/modules/simple_kafka_client.la
libtool: finish: PATH="/sbin:/bin:/usr/sbin:/usr/bin:/sbin" ldconfig -n /var/app/current/php-simple-kafka-client/modules
----------------------------------------------------------------------
Libraries have been installed in:
/var/app/current/php-simple-kafka-client/modules
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,-rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf'
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
Build complete.
Don't forget to run 'make test'.
Installing shared extensions: /usr/lib64/php/modules/
root@staging:/var/app/current/php-simple-kafka-client# sudo nano /etc/php.d/98_simple_kafka_client.ini
root@staging:/var/app/current/php-simple-kafka-client# php -v
PHP Warning: PHP Startup: Unable to load dynamic library 'simple_kafka_client.so' (tried: /usr/lib64/php/modules/simple_kafka_client.so (/usr/lib64/php/modules/simple_kafka_client.so: undefined symbol: rd_kafka_error_is_retriable), /usr/lib64/php/modules/simple_kafka_client.so.so (/usr/lib64/php/modules/simple_kafka_client.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP 7.4.33 (cli) (built: Nov 19 2022 00:22:13) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.33, Copyright (c), by Zend Technologies
@Drivible it seems to me, that during runtime it is using a different version of librdkafka
(probably below 1.6.0) since rd_kafka_error_is_retriable
is a function that was introduced then. Maybe phpinfo
can reveal more about what was being used for build and runtime
php -i | grep kafka
PHP Warning: PHP Startup: Unable to load dynamic library 'simple_kafka_client.so' (tried: /usr/lib64/php/modules/simple_kafka_client.so (/usr/lib64/php/modules/simple_kafka_client.so: undefined symbol: rd_kafka_error_is_retriable), /usr/lib64/php/modules/simple_kafka_client.so.so (/usr/lib64/php/modules/simple_kafka_client.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
/etc/php.d/98_simple_kafka_client.ini,
I don't know how to debug the module, but phpinfo doesn't provide any help.
I check with the CLI and with the <? phpinfo() ?>
web output. There's nothing mentioning Kafka, librdkafka or anything like it.
But it could still be using the wrong version. I'll try rebuilding the server and not trying to install the librdkafka from Yum and instead just compile from source.
Ohh I think you are right @nick-zh
Instead of trying to install via yum first I just built librdkafka from source and it worked!
ec2-user@staging-2:/$ php -i | grep kafka
simple_kafka_client
kafka support => enabled
librdkafka version (runtime) => 2.1.1-3-g68455a
librdkafka version (build) => 2.1.1.255
Thank you!