注: Mojaveの場合は下記記事をご覧ください。
ここからは Sierra の場合
phpenvでphp7.2をインストールしようとしたらエラーが出ました。
phpenv install 7.2.0beta2
[Info]: Loaded extension plugin
[Info]: Loaded apc Plugin.
[Info]: Loaded composer Plugin.
[Info]: Loaded github Plugin.
[Info]: Loaded uprofiler Plugin.
[Info]: Loaded xdebug Plugin.
[Info]: Loaded xhprof Plugin.
[Info]: Loaded zendopcache Plugin.
[Info]: php.ini-production gets used as php.ini
[Info]: Building 7.2.0beta2 into /Users/DQNEO/.phpenv/versions/7.2.0beta2
[Skipping]: Already downloaded and extracted https://downloads.php.net/~pollita/php-7.2.0beta2.tar.bz2
[Preparing]: /var/folders/zf/c8_mrv213wvf5nydz0mffls80000gn/T//php-build/source/7.2.0beta2
-----------------
| BUILD ERROR |
-----------------
Here are the last 10 lines from the log:
-----------------------------------------
configure: WARNING: This bison version is not supported for regeneration of the Zend/PHP parsers (found: 2.3, min: 204, excluded: ).
configure: error: Cannot find libz
-----------------------------------------
The full Log is available at '/tmp/php-build.7.2.0beta2.20170808200356.log'.
[Warn]: Aborting build.
対処法
$ xcode-select --install