macOS Catalina に PHP 7.3 をインストールしようとしたら BZip2 に関するエラー等、いくつかのエラーが発生しました。その解決方法を兼ねた備忘録です。

1: https://github.com/phpbrew/phpbrew の手順通りにインストール。lookup-prefix には homebrew を指定

% phpbrew lookup-prefix homebrew

2: BZip2 関係のエラーが発生。解決後、同種のその他エラーも発生

configure: error: Please reinstall the BZip2 distribution

3: 以下の手順で解決(諸々のエラーを一括で解決するコマンドです)

% brew install bzip2 zlib libzip
% phpbrew install 7.3 +default +bz2="$(brew --prefix bzip2)" +zlib="$(brew --prefix zlib)"

4: 完了

Congratulations! Now you have PHP with 7.3.12 as php-7.3.12

refs