LoginSignup
0
1

More than 1 year has passed since last update.

M1 Macにphpenvでphp 8.0を入れてみた

Last updated at Posted at 2022-05-08

かなり苦労したのでメモとして残しておく。

$ brew install autoconf \
bzip2 \
krb5 \
libedit \
libiconv \
libjpeg \
libpng \
libxml2 \
libzip \
oniguruma \
openssl@1.1 \
pkg-config \
tidy-html5

# icu4cの最新バージョン(70)はビルドできないので旧バージョンの68を使う
$ brew tap-new icu4c/taps
$ brew extract icu4c icu4c/taps --version 68
$ brew install icu4c/taps/icu4c@68

# pkg-configの環境変数
$ export PKG_CONFIG_PATH="/opt/homebrew/opt/krb5/lib/pkgconfig:\
/opt/homebrew/opt/icu4c@68/lib/pkgconfig:\
/opt/homebrew/opt/libedit/lib/pkgconfig:\
/opt/homebrew/opt/libjpeg/lib/pkgconfig:\
/opt/homebrew/opt/libpng/lib/pkgconfig:\
/opt/homebrew/opt/libxml2/lib/pkgconfig:\
/opt/homebrew/opt/libzip/lib/pkgconfig:\
/opt/homebrew/opt/oniguruma/lib/pkgconfig:\
/opt/homebrew/opt/openssl@1.1/lib/pkgconfig:\
/opt/homebrew/opt/tidy-html5/lib/pkgconfig" 

# M1はPHP JITを支援しないのでPCREを別バージョンに入れる
$ export PHP_BUILD_CONFIGURE_OPTS="--with-external-pcre=$(brew --prefix pcre2) \
--with-bz2=$(brew --prefix bzip2) \
--with-iconv=$(brew --prefix libiconv) \
--with-tidy=$(brew --prefix tidy-html5)"
$ phpenv install 8.0.12
0
1
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
1