LoginSignup
73
87

More than 5 years have passed since last update.

CentOS7にPHP7をyumでインストールする

Last updated at Posted at 2016-05-25

CentOS7の標準リポジトリのPHPバージョンは5.4です。

PHP7をインストールするには自分でコンパイルする方法もありますが、
ここではyumを使って簡単にインストールする方法を紹介します。

ゴールまでいろいろインストールしていきますが、すでにインストールされているのはスキップで大丈夫です。

リポジトリ追加

EPELとRemiリポジトリの追加が必要です。
Remiリポジトリ追加のためにはEPELリポジトリ追加が必要なので、先にEPELリポジトリを追加します。

EPELリポジトリ

# yum install epel-release

Remiリポジトリ

# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm

※RemiのrpmダウンロードURLは以下から参考にしました。
http://rpms.famillecollet.com/

PHP7をインストール

# yum install --enablerepo=remi,remi-php70 php php-devel php-mbstring php-pdo php-gd

php.iniの場所

vi /etc/php.ini

73
87
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
73
87