LoginSignup
10
13

More than 5 years have passed since last update.

CentOSにPHP7とcomposerをインストールする方法

Last updated at Posted at 2016-06-28

概要

yumでインストール

CentOS6.7の場合

$ sudo rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
$ sudo yum -y install --enablerepo=remi,remi-php70 php php-devel php-mbstring php-pdo php-gd php-mysql php-xml

CentOS7の場合

$ sudo yum -y install epel-release.noarch
$ sudo rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
$ sudo yum -y install --enablerepo=remi,remi-php70 php php-devel php-mbstring php-pdo php-gd php-mysql php-xml

補足

新しいレポジトリを読みに行ってくれない場合は下記コマンドでキャッシュを削除してみてください。

$ sudo yum clean all

composerのインストール

$ curl -sS https://getcomposer.org/installer | php -- --install-dir=/tmp
$ sudo mv /tmp/composer.phar /usr/local/bin/composer

[参考]
CentOS6/CentOS7にPHP5.6/PHP7をyumでインストール

[関連記事]
CentOSにMySQL5.6のインストール

10
13
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
10
13