0
1

More than 1 year has passed since last update.

phpenvでUbuntu 20.04にphp7.4環境構築

Posted at

2億回くらい同じハマり方をしているので、いい加減にメモ

手順

phpenvをセットアップする

$ git clone git://github.com/phpenv/phpenv.git ~/.phpenv

phpenvにパスを通してphpenvを使えるようにする。
bashrcとかに書いとくといい

$ export PATH="$HOME/.phpenv/bin:$PATH"
$ eval "$(phpenv init -)"

php-buildのプラグインを追加

$ git clone https://github.com/php-build/php-build $(phpenv root)/plugins/php-build

phpのビルドに必要なパッケージをインストール

$ sudo apt install \
  libxml2-dev \
  libkrb5-dev \
  libssl-dev \
  libsqlite3-dev \
  libbz2-dev \
  libcurl4-openssl-dev \
  libpng-dev \
  libjpeg-dev \
  libfreetype6-dev \
  libonig-dev \
  libxslt1-dev \
  libtidy-dev \
  libzip-dev

phpenvでバージョンを指定してビルドインストール

$ phpenv install 7.4.25
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