如何在MacOS上通过asdf-php插件安装PHP 7.2.18



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

我看到很多缺少库的错误消息(openssl,readline,zlib,...(。

经过大量的研究、跟踪和错误以及挖掘 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

相关内容

  • 没有找到相关文章

最新更新