configure: error: Cannot find libz on macOS Sierra

DQNEO
DQNEO
Aug 8, 2017 · 1 min read

I encountered this error while building php7.2 on macOS Sierra

$ 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.

Solution:

$ xcode-select --install

DQNEO

Written by

https://github.com/DQNEO

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade