phpenv を mojave にインストールしようとした際、リスト一覧に出なかったのと、インストールに失敗したのでメモ
phpenv or anyenvのアップグレード
環境によって違う
anyenvをアップデートして最新モジュールを取得
$ brew upgrade anyenv
phpenvをアップデート
$ cd ~/.anyenv/envs/phpenv/plugins/php-build && git pull $ phpenv install 7.3.3
インストール中にエラーが出た場合
configure: error: Cannot find zlib
対処方法
Mojave のインストーラーからheaderをインストールすれば良い模様。Xcodeのコマンドラインインストーラーではインストールされていないモジュールとなっているため、とのこと、
$sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target / ##結果↓ installer: Package name is macOS_SDK_headers_for_macOS_10.14 installer: Installing at base path / installer: The install was successful
libzip distribution のエラー
その後再度、7.3.3のインストールを実行すると、今度はコンパイル中に以下のエラーが出力された。
----------------- | BUILD ERROR | ----------------- Here are the last 10 lines from the log: ----------------------------------------- configure: error: Please reinstall the libzip distribution -----------------------------------------
どうも自分の環境にlibzipがインストールされていなかった模様。
$ brew install libzip Updating Homebrew... ==> Downloading https://homebrew.bintray.com/bottles/libzip-1.5.2.mojave.bottle.tar.gz ######################################################################## 100.0%
以上。
参考:
Install failed, "zlib not available" on macOS Mojave · Issue #1219 · pyenv/pyenv
Description Platform information (e.g. Ubuntu Linux 16.04): macOS Mojave 10.14 OS architecture (e.g. amd64):amd64 pyenv version: 1.2.7 Python version: 3.7.0 &am...