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?

M3 Mac への phpenv を使用した php8.3 のインストールメモ

Posted at

UpdatedAt: 2025-01-29

anyenv は入ってる状態からの phpenv と php8.3 のインストール
最終的なのは以下のイメージ

$ anyenv -v
anyenv 1.1.5
$ phpenv -v
phpenv v1.0.0
$ php -v
PHP 8.3.13 (cli) (built: Jan 29 2025 13:28:27) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.3.13, Copyright (c) Zend Technologies
    with Zend OPcache v8.3.13, Copyright (c), by Zend Technologies
    with Xdebug v3.3.1, Copyright (c) 2002-2023, by Derick Rethans

手順

# anyenv で phpenv 入れる
anyenv install phpenv

# 環境変数再読み込みするため、ターミナルを新規タブか新規ウインドウで続きを実行する

# php install のためのライブラリ群インスト
# 参考: https://kojirooooocks.hatenablog.com/entry/2022/10/14/004658
brew install pkg-config bzip2 libjpeg libpng libiconv tidy-html5 libzip autoconf openssl libxml2 oniguruma pcre2

# 足りなかったので追加
brew install gcc
# Macのgrepではだめだったのでこっちを使わせるために追加
brew install grep
echo 'export PATH="$(brew --prefix grep)/libexec/gnubin:$PATH"' >> ~/.zshrc
source ~/.zshrc
# gcc やらを指定して phpenv install を実行する(クソなが1文で実行する)
CC=$(brew --prefix)/bin/gcc-14 CXX=$(brew --prefix)/bin/g++-14 CXXFLAGS="-std=c++17" PKG_CONFIG_PATH="/opt/homebrew/opt/jpeg/lib/pkgconfig" PHP_BUILD_CONFIGURE_OPTS="--with-bz2=$(brew --prefix bzip2) --with-iconv=$(brew --prefix libiconv) --with-tidy=$(brew --prefix tidy-html5)" phpenv install 8.3.13
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?