Install PHP to macOS with phpenv
code:sh
git clone https://github.com/madumlao/phpenv.git ~/.phpenv
git clone https://github.com/php-build/php-build.git ~/.phpenv/plugins/php-build
code:sh
# phpenv
export PHPENV_ROOT="$HOME/.phpenv"
export PATH="$PHPENV_ROOT/bin:$PATH"
eval "$(phpenv init -)"
code:sh
brew install bzip2 re2c openssl bison libxml2 autoconf automake icu4c libjpeg libpng libmcrypt krb5
code:sh
export PKG_CONFIG_PATH="/usr/local/opt/icu4c/lib/pkgconfig:/usr/local/opt/krb5/lib/pkgconfig:/usr/local/opt/openssl@1.1/lib/pkgconfig"
code:sh
phpenv install 7.4.7