0

我正在尝试通过asdf-php 插件安装 PHP 7.2 。

我看到很多关于缺少库(openssl、readline、zlib、...)的错误消息。

4

1 回答 1

4

经过大量的研究、跟踪和错误以及对 GitHub 问题的挖掘,我发现由于 PHP 构建过程的巨大差异,这个插件被放弃了。但是,我通过执行以下操作找到了解决方案:

xcode-select --install

sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /

brew tap magrathealabs/homebrew-mlabs
brew install pkg-config freetype bison bison27 gettext icu4c icu4c@58.1 jpeg libiconv libpng openssl readline zlib libedit

ln -s /usr/local/Cellar/openssl/1.0.2r/include/openssl /usr/local/include/openssl

export PHP_CONFIGURE_OPTIONS="--with-zlib-dir=$(brew --prefix zlib) --with-bz2=$(brew --prefix bzip2) --with-iconv=$(brew --prefix libiconv) --with-readline=$(brew --prefix readline) --with-libedit=$(brew --prefix libedit) --with-tidy=$(brew --prefix tidy-html5)"

export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig:/usr/local/opt/readline/lib/pkgconfig:/usr/local/opt/icu4c@58.1/lib/pkgconfig"

export CPPFLAGS="$CPPFLAGS -I/usr/local/opt/openssl/include -I/usr/local/opt/libedit/include -I/usr/local/opt/readline/include -I/usr/local/opt/icu4c@58.1/include"

export LDFLAGS="$LDFLAGS -L/usr/local/opt/openssl/lib -L/usr/local/opt/bison/lib -L/usr/local/opt/libedit/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/icu4c@58.1/lib"

export PATH="$(brew --prefix bison)/bin:$(brew --prefix icu4c@58.1)/bin:$(brew --prefix icu4c)/sbin:$PATH"



asdf install 7.2.18
于 2019-05-29T15:39:52.303 回答