DTI, Serversman (VPS) で、PHP5.4→7.3へアップデートした時のメモ

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

実際の作業コマンドなど

  1. yum install epel-release
  2. rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
  3. 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
  4. 「Cannot retrieve metalink for repository: epel/x86_64. Please verify its path and try again」というエラー発生
  5. /etc/yum.repos.d/epel.repo で、Path変更(参考: http://d.hatena.ne.jp/C_6B4A2B/20130427/1367073209 )
  6. 再度実行→
    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
  7. 完了
  8. > 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 
  9. > 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ということが分かって、勉強にもなった。