Just a quickie note for any who might encounter this issue.
After upgrading to MacOS Sierra, my Homebrew install of PHP 7.0 failed to update.
==> Upgrading homebrew/php/php70
==> Downloading https://php.net/get/php-7.0.11.tar.bz2/from/this/mirror
Already downloaded: /Users/swschulz/Library/Caches/Homebrew/php70-7.0.11
==> ./configure --prefix=/usr/local/Cellar/php70/7.0.11_4 --localstatedir=/usr/l
Last 15 lines from /Users/swschulz/Library/Logs/Homebrew/php70/01.configure:
checking for OpenSSL support... yes
checking if the location of ZLIB install directory is defined... no
configure: error: Cannot find libz
Since I was on the beta version of Sierra, I waited for an automatic resolution to the issue once the final version was released. When it didn’t come, I did the usual, and came across this issue on the Homebrew tracker which (extraneously) contained the solution to this issue.
Fortunately, the fix was simply to run the
xcode-select command again to let it update the command line tools, which also rebuilds/reinstalls the necessary libraries.
$ xcode-select --install
xcode-select: note: install requested for command line developer tools
After that, PHP built and installed as expected. Gotta love the simple ones.