0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

MacOS brew phpenv環境 にphpをインストールする

Posted at

phpenv install 7.4.3 で済めばよかったのだが、なかなか苦労したのでメモ

PHP 7

PHP_BUILD_CONFIGURE_OPTS="--with-bz2=$(brew --prefix bzip2) --with-iconv=$(brew --prefix libiconv)" \
PKG_CONFIG_PATH=/usr/local/opt/krb5/lib/pkgconfig:/usr/local/opt/openssl@1.1/lib/
pkgconfig:/usr/local/opt/icu4c/lib/pkgconfig:/usr/local/opt/libedit/lib/pkgconfig \
phpenv install -v 7.4.3
  • -v オプションで ./configure のエラー出力を見ながらやると良い
  • ./configure のエラーで PKG_CONFIG_PATH の追加をすすめられたら、対応するパスを追加
  • それ以外のエラーは PHP_BUILD_CONFIGURE_OPTS で解決する
  • php-build の default_configure_options に設定を書いておけるが、バージョン毎に差がありそうなためやめておく

PHP 5

configure は成功するもののコンパイルに失敗

PHP_BUILD_CONFIGURE_OPTS="--with-bz2=$(brew --prefix bzip2) --with-iconv=$(brew --prefix libiconv) --with-zlib=$(brew --prefix zlib) --with-curl=$(brew --prefix curl) --with-libedit=/usr/local/opt/libedit" \
PKG_CONFIG_PATH=/usr/local/opt/krb5/lib/pkgconfig:/usr/local/opt/openssl@1.1/lib/pkgconfig:/usr/local/opt/icu4c/lib/pkgconfig:/usr/local/opt/libedit/lib/pkgconfig:/usr/local/opt/curl/lib/pkgconfig \
phpenv install -v 5.6.40
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?