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

Ability to provide custom librdkafka path during install #526

Merged
merged 1 commit into from
Jul 2, 2022

Conversation

Wirone
Copy link
Contributor

@Wirone Wirone commented Jun 14, 2022

Solution taken from ssh2 extension, thanks to this I was able to install that extension with pecl install ssh2 and provide Homebrew's path to libssh2.

Tested by cloning this repo, checking out patch-1 branch and executing pecl install package.xml:

...
librdkafka installation path? [autodetect] : /opt/homebrew/opt/librdkafka
building in /private/tmp/pear/temp/pear-build-gkorbaaNXDnl/rdkafka-6.0.2
running: /private/tmp/pear/temp/rdkafka/configure --with-php-config=/opt/homebrew/opt/php@7.4/bin/php-config --with-rdkafka=/opt/homebrew/opt/librdkafka
...
Build process completed successfully
Installing '/Users/gkorba/.asdf/installs/php/7.4.30/lib/php/extensions/no-debug-non-zts-20190902/rdkafka.so'
install ok: channel://pecl.php.net/rdkafka-6.0.2
configuration option "php_ini" is not set to php.ini location
You should add "extension=rdkafka.so" to php.ini

It worked 🎉

Fixes #503

Solution taken from `ssh2` extension, thanks to this I was able to install that extension with `pecl install ssh2` and provide Homebrew's path to `libssh2`.

Fixes arnaud-lb#503
@Wirone
Copy link
Contributor Author

Wirone commented Jun 15, 2022

FYI: on Homebrew's PHP it was failing with missing pcre2.h though. --with-pcre-regex / --with-pcre-dir (found here) and --with-external-pcre (found here) was not working (unrecognized option) 😩 I was able to workaround PCRE2 problem with:

ln -s /opt/homebrew/opt/pcre2/include/pcre2.h /opt/homebrew/Cellar/php@7.4/7.4.30/include/php/ext/pcre/pcre2.h

which is not proper solution, but it allowed me to test if extension is built and working.

On asdf's PHP (7.4, 8.1) extension was properly installed just by passing path to PCRE2. So it seems like it's working 🙂

@arnaud-lb arnaud-lb merged commit a091f7b into arnaud-lb:6.x Jul 2, 2022
@arnaud-lb
Copy link
Owner

Awesome! Thank you.

The interactive prompt doesn't appear to break non-interactive installs, so that's great.

@Wirone Wirone deleted the patch-1 branch July 2, 2022 11:15
@arnaud-lb
Copy link
Owner

Released on pecl in version 6.0.3

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

Successfully merging this pull request may close these issues.

checking for librdkafka/rdkafka.h" in default path... not found
2 participants