asdf-community/asdf-php

php 8.1.1 not being installed: Please reinstall the BZip2 distribution

StephanMeijer opened this issue · 3 comments

Using Mac (M1 Max)

...

configure.ac:1544: the top level
configure: WARNING: unrecognized options: --enable-gd-native-ttf, --enable-wddx, --enable-zip, --with-gd, --with-mysql, --with-xmlrpc
configure: error: Please reinstall the BZip2 distribution

Using following install steps:

export LIBXML_CFLAGS="$(xml2-config --cflags)"
export LIBXML_LIBS="$(xml2-config --libs)"
export SQLITE_CFLAGS="-I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include"
export SQLITE_LIBS="-L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib"

export LDFLAGS="-liconv"

export PHP_CONFIGURE_OPTIONS="--with-zlib-dir=\"$(brew --prefix zlib)\" --with-bz2=\"$(brew --prefix bzip2)\" --with-readline=\"$(brew --prefix readline)\" --with-libedit=\"$(brew --prefix libedit)\" --with-tidy=\"$(brew --prefix tidy-html5)\" --with-iconv=\"$(brew --prefix libiconv)\" --with-openssl=\"/usr/local/Cellar/openssl@1.1/1.1.1k\" --with-curl=\"$(brew --prefix curl)\""

export PATH="$(brew --prefix bison)/bin:$(brew --prefix icu4c)/bin:$(brew --prefix icu4c)/sbin:$PATH"
asdf install php 8.1.1
Wirone commented

I am also struggling with --with-bz2, tried with brew --prefix bzip2 and explicit paths (not symlinked).. I did brew install bzip2, added it to the $PATH and I always get:

checking for BZip2 support... yes
checking for BZip2 in default path... not found
configure: error: Please reinstall the BZip2 distribution

Any ideas?

Wirone commented

@StephanMeijer please try without nested quotings: export PHP_CONFIGURE_OPTIONS="--with-bz2=$(brew --prefix bzip2)". In my case it solved the issue 🥳.

@Wirone Thanks for your feedback. Nowadays I use MacPorts for installing PHP on macOs. This seems to be more stable.