CentOS7でyumでインストールしたPHP7.0をPHP7.1にアップデートする
作業メモ
■OSの確認
# cat /etc/redhat-release CentOS Linux release 7.2.1511 (Core)
■現在のPHPの確認
# php -v PHP 7.0.13 (cli) (built: Nov 8 2016 20:16:29) ( NTS ) Copyright (c) 1997-2016 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
■「remi-php71.repo」があるか確認する
# cat /etc/yum.repos.d/remi-php71.repo # This repository only provides PHP 7.1 and its extensions # NOTICE: common dependencies are in "remi-safe" [remi-php71] name=Remi's PHP 7.1 RPM repository for Enterprise Linux 7 - $basearch #baseurl=http://rpms.remirepo.net/enterprise/7/php71/$basearch/ mirrorlist=http://rpms.remirepo.net/enterprise/7/php71/mirror enabled=0 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi [remi-php71-debuginfo] name=Remi's PHP 7.1 RPM repository for Enterprise Linux 7 - $basearch - debuginfo baseurl=http://rpms.remirepo.net/enterprise/7/debug-php71/$basearch/ enabled=0 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi [remi-php71-test] name=Remi's PHP 7.1 test RPM repository for Enterprise Linux 7 - $basearch #baseurl=http://rpms.remirepo.net/enterprise/7/test71/$basearch/ mirrorlist=http://rpms.remirepo.net/enterprise/7/test71/mirror enabled=0 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi [remi-php71-test-debuginfo] name=Remi's PHP 7.1 test RPM repository for Enterprise Linux 7 - $basearch - debuginfo baseurl=http://rpms.remirepo.net/enterprise/7/debug-test71/$basearch/ enabled=0 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi
■php71が表示されるのを確認する
# yum search php ・・・ php71.x86_64 : Package that installs PHP 7.1 php71-php.x86_64 : PHP scripting language for creating dynamic web sites ・・・
■udpateする
# yum update php --enablerepo=remi-php71
■バージョンの確認
# php -v PHP 7.1.7 (cli) (built: Jul 6 2017 13:31:15) ( NTS ) Copyright (c) 1997-2017 The PHP Group
※apacheの再起動なども忘れずに。