LoginSignup
42
44

More than 5 years have passed since last update.

CentOS7にPHP5.6をインストールする。

Posted at

remiのrpmパッケージを使ってインストールを進めていく。
前提として、CentOSにはPHP5.4など古いバージョンがインストールされていない想定です。

epelとremiのリポジトリをインストール

リポジトリをインストールします。
※URLはリンク切れしていないか確認しましょう。

$ sudo rpm -Uvh http://ftp.iij.ad.jp/pub/linux/fedora/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
$ sudo rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm

PHP5.6のインストール

yumからPHP5.6をインストール

$ sudo yum install --enablerepo=remi --enablerepo=remi-php56 php php-opcache php-devel php-mbstring php-mcrypt php-mysqlnd php-phpunit-PHPUnit php-pecl-xdebug php-pecl-xhprof

インストール後の確認

PHPのバージョンの確認をしておく

$ php --version
PHP 5.6.5 (cli) (built: Jan 21 2015 17:39:53) 
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2014 Zend Technologies
    with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies
    with Xdebug v2.2.7, Copyright (c) 2002-2015, by Derick Rethans
42
44
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
42
44