ServersmanのVPSを利用している。
最近、VPSを初期化(ブログセット)したが、PHP5.4なので、最新の7.3にアップグレードした。
少し手間取ったので、自分メモだけど、投稿。
誰かの糧になるのなら、幸い。
PHP環境
<以降前のPHP環境>
php-common-5.4.16-23.el7_0.x86_64
php-pdo-5.4.16-23.el7_0.x86_64
php-xml-5.4.16-23.el7_0.x86_64
php-5.4.16-23.el7_0.x86_64
php-cli-5.4.16-23.el7_0.x86_64
php-gd-5.4.16-23.el7_0.x86_64
php-mysql-5.4.16-23.el7_0.x86_64
php-mbstring-5.4.16-23.el7_0.x86_64
<以降後のPHP環境>
php-common-7.3.6-3.el7.remi.x86_64
php-cli-7.3.6-3.el7.remi.x86_64
php-pdo-7.3.6-3.el7.remi.x86_64
php-gd-7.3.6-3.el7.remi.x86_64
php-mysqlnd-7.3.6-3.el7.remi.x86_64
php-xml-7.3.6-3.el7.remi.x86_64
php-json-7.3.6-3.el7.remi.x86_64
php-mbstring-7.3.6-3.el7.remi.x86_64
php-7.3.6-3.el7.remi.x86_64
実際の作業コマンドなど
- yum install epel-release
- rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
- yum update –enablerepo=remi,remi-php73 php php-pdo php-mbstring php-common php-cli php-mysql php-xml php-cli php-gd php-mysql
- 「Cannot retrieve metalink for repository: epel/x86_64. Please verify its path and try again」というエラー発生
- /etc/yum.repos.d/epel.repo で、Path変更(参考: http://d.hatena.ne.jp/C_6B4A2B/20130427/1367073209 )
- 再度実行→
yum update –enablerepo=remi,remi-php73 php php-pdo php-mbstring php-common php-cli php-mysql php-xml php-cli php-gd php-mysql - 完了
- > php -v
PHP 7.3.6 (cli) (built: May 28 2019 09:32:59) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.6, Copyright (c) 1998-2018 Zend Technologies
- > rpm -qa | grep php
php-common-7.3.6-3.el7.remi.x86_64
php-cli-7.3.6-3.el7.remi.x86_64
php-pdo-7.3.6-3.el7.remi.x86_64
php-gd-7.3.6-3.el7.remi.x86_64
php-mysqlnd-7.3.6-3.el7.remi.x86_64
php-xml-7.3.6-3.el7.remi.x86_64
php-json-7.3.6-3.el7.remi.x86_64
php-mbstring-7.3.6-3.el7.remi.x86_64
php-7.3.6-3.el7.remi.x86_64
久々にコマンド叩いた。気持ちいい。
4のエラーには、リポジトリのPathを変更してやればOKということが分かって、勉強にもなった。