Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't install extension on macOS via PECL #549

Open
djklim87 opened this issue Mar 26, 2024 · 1 comment
Open

Can't install extension on macOS via PECL #549

djklim87 opened this issue Mar 26, 2024 · 1 comment
Labels

Comments

@djklim87
Copy link

Description

Install librdkafka

brew install librdkafka  
Warning: librdkafka 2.3.0 is already installed and up-to-date.
To reinstall 2.3.0, run:
  brew reinstall librdkafka

Install extension

pecl install rdkafka   
WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update
downloading rdkafka-6.0.3.tgz ...
Starting to download rdkafka-6.0.3.tgz (55,561 bytes)
.............done: 55,561 bytes
72 source files, building
running: phpize
Configuring for:
PHP Api Version:         20230831
Zend Module Api No:      20230831
Zend Extension Api No:   420230831
librdkafka installation path? [autodetect] : 
building in /private/tmp/pear/temp/pear-build-djklim87ZbvEud/rdkafka-6.0.3
running: /private/tmp/pear/temp/rdkafka/configure --with-php-config=/opt/homebrew/opt/php/bin/php-config --with-rdkafka
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for pkg-config... /usr/local/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 the compiler supports GNU C... yes
checking whether cc accepts -g... yes
checking for cc option to enable C11 features... none needed
checking how to run the C preprocessor... cc -E
checking for egrep -e... (cached) /usr/bin/grep -E
checking for icc... no
checking for suncc... no
checking for system library directory... lib
checking if compiler supports -Wl,-rpath,... yes
checking build system type... aarch64-apple-darwin23.3.0
checking host system type... aarch64-apple-darwin23.3.0
checking target system type... aarch64-apple-darwin23.3.0
checking for PHP prefix... /opt/homebrew/Cellar/php/8.3.2
checking for PHP includes... -I/opt/homebrew/Cellar/php/8.3.2/include/php -I/opt/homebrew/Cellar/php/8.3.2/include/php/main -I/opt/homebrew/Cellar/php/8.3.2/include/php/TSRM -I/opt/homebrew/Cellar/php/8.3.2/include/php/Zend -I/opt/homebrew/Cellar/php/8.3.2/include/php/ext -I/opt/homebrew/Cellar/php/8.3.2/include/php/ext/date/lib
checking for PHP extension directory... /opt/homebrew/Cellar/php/8.3.2/pecl/20230831
checking for PHP installed headers prefix... /opt/homebrew/Cellar/php/8.3.2/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for gawk... no
checking for nawk... no
checking for awk... awk
checking if awk is broken... no
checking for rdkafka support... yes, shared
checking for librdkafka/rdkafka.h" in default path... found in /usr/local
checking for rd_kafka_new in -lrdkafka... no
configure: error: wrong rdkafka lib version or lib not found
ERROR: `/private/tmp/pear/temp/rdkafka/configure --with-php-config=/opt/homebrew/opt/php/bin/php-config --with-rdkafka' failed

php-rdkafka Version

rdkafka-6.0.3

librdkafka Version

librdkafka 2.3.0

PHP Version

8.3.2

Operating System

MacOS

Kafka Version

No response

@djklim87 djklim87 added the bug label Mar 26, 2024
@akandels
Copy link

akandels commented Aug 7, 2024

Your error is it can't find librdkafka (a C-extension, installed separately). Install it first: https://formulae.brew.sh/formula/librdkafka

Then, when you re-run your PECL install, when prompted, enter the path to where librdkafka installed (depends on your Mac arch, but my M2 ended up at /opt/homebrew/Cellar/librdkafka/2.5.0). The default "detect" was not able to resolve this path and I had to type it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants