CentOS7.1_php7.3への更新

CentOS+WordPressの環境を構築しています。phpのバージョンが5.4.16となっておりWPの5.2.1に更新ができない状況です。php7.3に更新したときのメモとなります。

更新前環境

# cat /etc/centos-release
CentOS Linux release 7.1.1503 (Core)

# php -v
PHP 5.4.16 (cli) (built: Oct 30 2018 19:30:51)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies

php関連
# rpm -qa | grep php
php-common-5.4.16-46.el7.x86_64
php-5.4.16-46.el7.x86_64
php-mysql-5.4.16-46.el7.x86_64
php-cli-5.4.16-46.el7.x86_64
php-pdo-5.4.16-46.el7.x86_64
php-mbstring-5.4.16-46.el7.x86_64

php.iniのバックアップ

# cp php.ini php.inibk

epel・remi 導入

# yum install epel-release
# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm

php removeとremove確認

# yum remove php-*
# rpm -qa | grep php

php7.3 install → 失敗

 

# yum install --enablerepo=remi,remi-php73 php php 
読み込んだプラグイン:fastestmirror

 One of the configured repositories failed (不明),
 and yum doesn't have enough cached data to continue. At this point the only
 safe thing yum can do is fail. There are a few ways to work "fix" this:

     1. Contact the upstream for the repository and get them to fix the problem.

     2. Reconfigure the baseurl/etc. for the repository, to point to a working
        upstream. This is most often useful if you are using a newer
        distribution release than is supported by the repository (and the
        packages for the previous distribution release still work).

     3. Disable the repository, so yum won't use it by default. Yum will then
        just ignore the repository until you permanently enable it again or use
        --enablerepo for temporary usage:

            yum-config-manager --disable <repoid>

     4. Configure the failing repository to be skipped, if it is unavailable.
        Note that yum will try to contact the repo. when it runs most commands,
        so will have to try and fail each time (and thus. yum will be be much
        slower). If it is a very temporary problem though, this is often a nice
        compromise:

            yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true

Cannot retrieve metalink for repository: epel/x86_64. Please verify its path and try again

 

epel repositoryが駄目

epel repository編集 metalinkをコメントアウト baseurlのコメントを外す

[epel]
name=Extra Packages for Enterprise Linux 7 - $basearch
baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch
#metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch

php7.3 install → 成功

# yum install --enablerepo=remi,remi-php73 php php-mbstring

読み込んだプラグイン:fastestmirror
base                                                     | 3.6 kB     00:00
epel                                                     | 5.3 kB     00:00
extras                                                   | 3.4 kB     00:00
mysql-connectors-community                               | 2.5 kB     00:00
mysql-tools-community                                    | 2.5 kB     00:00
mysql56-community                                        | 2.5 kB     00:00
remi                                                     | 3.0 kB     00:00
remi-php73                                               | 3.0 kB     00:00
remi-safe                                                | 3.0 kB     00:00
updates                                                  | 3.4 kB     00:00
(1/6): epel/x86_64/updateinfo                              | 974 kB   00:00
epel/x86_64/group_gz           FAILED

404 Not Found
007fdd84e7ae4981b257d3b94c3c9f5d7b0dda6baa098-comps-Everything.x86_64.xml.gz: [E rrno 14] HTTPS Error 302 - Found 他のミラーを試します。 epel/x86_64/primary_db FAILED
404 Not Found
6036ca7aadbe68cf6f987f4930d4a0e372a9ad0c7048e-primary.sqlite.bz2: [Errno 14] HTT PS Error 302 - Found 他のミラーを試します。 (2/6): remi-php73/primary_db | 197 kB 00:02 (3/6): remi-safe/primary_db | 1.5 MB 00:03 (4/6): remi/primary_db | 2.4 MB 00:03 Loading mirror speeds from cached hostfile * base: ty1.mirror.newmediaexpress.com * extras: ty1.mirror.newmediaexpress.com * remi: ftp.riken.jp * remi-php73: ftp.riken.jp * remi-safe: ftp.riken.jp * updates: ty1.mirror.newmediaexpress.com epel/x86_64/primary_db | 6.7 MB 00:00 依存性の解決をしています --> トランザクションの確認を実行しています。 ---> パッケージ php.x86_64 0:7.3.6-3.el7.remi を インストール --> 依存性の処理をしています: php-cli(x86-64) = 7.3.6-3.el7.remi のパッケージ: p hp-7.3.6-3.el7.remi.x86_64 --> 依存性の処理をしています: php-common(x86-64) = 7.3.6-3.el7.remi のパッケージ : php-7.3.6-3.el7.remi.x86_64 --> 依存性の処理をしています: libargon2.so.0()(64bit) のパッケージ: php-7.3.6-3. el7.remi.x86_64 ---> パッケージ php-mbstring.x86_64 0:7.3.6-3.el7.remi を インストール --> 依存性の処理をしています: libonig.so.5()(64bit) のパッケージ: php-mbstring-7 .3.6-3.el7.remi.x86_64 --> トランザクションの確認を実行しています。 ---> パッケージ libargon2.x86_64 0:20161029-3.el7 を インストール ---> パッケージ oniguruma5.x86_64 0:6.9.2-1.el7.remi を インストール ---> パッケージ php-cli.x86_64 0:7.3.6-3.el7.remi を インストール ---> パッケージ php-common.x86_64 0:7.3.6-3.el7.remi を インストール --> 依存性の処理をしています: php-json(x86-64) = 7.3.6-3.el7.remi のパッケージ: php-common-7.3.6-3.el7.remi.x86_64 --> トランザクションの確認を実行しています。 ---> パッケージ php-json.x86_64 0:7.3.6-3.el7.remi を インストール --> 依存性解決を終了しました。 依存性を解決しました ================================================================================ Package アーキテクチャー バージョン リポジトリー 容量 ================================================================================ インストール中: php x86_64 7.3.6-3.el7.remi remi-php73 3.2 M php-mbstring x86_64 7.3.6-3.el7.remi remi-php73 509 k 依存性関連でのインストールをします: libargon2 x86_64 20161029-3.el7 epel 23 k oniguruma5 x86_64 6.9.2-1.el7.remi remi 192 k php-cli x86_64 7.3.6-3.el7.remi remi-php73 4.9 M php-common x86_64 7.3.6-3.el7.remi remi-php73 1.1 M php-json x86_64 7.3.6-3.el7.remi remi-php73 64 k トランザクションの要約 ================================================================================ インストール 2 パッケージ (+5 個の依存関係のパッケージ) 総ダウンロード容量: 10 M インストール容量: 40 M Is this ok [y/d/N]: y Downloading packages: 警告: /var/cache/yum/x86_64/7/remi/packages/oniguruma5-6.9.2-1.el7.remi.x86_64.r pm: ヘッダー V4 DSA/SHA1 Signature、鍵 ID 00f97f56: NOKEY oniguruma5-6.9.2-1.el7.remi.x86_64.rpm の公開鍵がインストールされていません (1/7): oniguruma5-6.9.2-1.el7.remi.x86_64.rpm | 192 kB 00:00 php-7.3.6-3.el7.remi.x86_64.rpm の公開鍵がインストールされていません --:-- ETA (2/7): php-7.3.6-3.el7.remi.x86_64.rpm | 3.2 MB 00:00 (3/7): php-mbstring-7.3.6-3.el7.remi.x86_64.rpm | 509 kB 00:00 警告: /var/cache/yum/x86_64/7/epel/packages/libargon2-20161029-3.el7.x86_64.rpm: ヘッダー V3 RSA/SHA256 Signature、鍵 ID 352c64e5: NOKEY libargon2-20161029-3.el7.x86_64.rpm の公開鍵がインストールされていません (4/7): libargon2-20161029-3.el7.x86_64.rpm | 23 kB 00:00 (5/7): php-json-7.3.6-3.el7.remi.x86_64.rpm | 64 kB 00:00 (6/7): php-cli-7.3.6-3.el7.remi.x86_64.rpm | 4.9 MB 00:02 (7/7): php-common-7.3.6-3.el7.remi.x86_64.rpm | 1.1 MB 00:03 -------------------------------------------------------------------------------- 合計 2.8 MB/s | 10 MB 00:03 file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi から鍵を取得中です。 Importing GPG key 0x00F97F56: Userid : "Remi Collet <RPMS@FamilleCollet.com>" Fingerprint: 1ee0 4cce 88a4 ae4a a29a 5df5 004e 6f47 00f9 7f56 Package : remi-release-7.6-2.el7.remi.noarch (installed) From : /etc/pki/rpm-gpg/RPM-GPG-KEY-remi 上記の処理を行います。よろしいでしょうか? [y/N]y file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 から鍵を取得中です。 Importing GPG key 0x352C64E5: Userid : "Fedora EPEL (7) <epel@fedoraproject.org>" Fingerprint: 91e9 7d7c 4a5e 96f1 7f3e 888f 6a2f aea2 352c 64e5 Package : epel-release-7-11.noarch (@extras) From : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 上記の処理を行います。よろしいでしょうか? [y/N]y Running transaction check Running transaction test Transaction test succeeded Running transaction インストール中 : php-json-7.3.6-3.el7.remi.x86_64 1/7 インストール中 : php-common-7.3.6-3.el7.remi.x86_64 2/7 インストール中 : libargon2-20161029-3.el7.x86_64 3/7 インストール中 : php-cli-7.3.6-3.el7.remi.x86_64 4/7 インストール中 : oniguruma5-6.9.2-1.el7.remi.x86_64 5/7 インストール中 : php-mbstring-7.3.6-3.el7.remi.x86_64 6/7 インストール中 : php-7.3.6-3.el7.remi.x86_64 7/7 検証中 : php-cli-7.3.6-3.el7.remi.x86_64 1/7 検証中 : oniguruma5-6.9.2-1.el7.remi.x86_64 2/7 検証中 : php-common-7.3.6-3.el7.remi.x86_64 3/7 検証中 : php-mbstring-7.3.6-3.el7.remi.x86_64 4/7 検証中 : libargon2-20161029-3.el7.x86_64 5/7 検証中 : php-json-7.3.6-3.el7.remi.x86_64 6/7 検証中 : php-7.3.6-3.el7.remi.x86_64 7/7 インストール: php.x86_64 0:7.3.6-3.el7.remi php-mbstring.x86_64 0:7.3.6-3.el7.remi 依存性関連をインストールしました: libargon2.x86_64 0:20161029-3.el7 oniguruma5.x86_64 0:6.9.2-1.el7.remi php-cli.x86_64 0:7.3.6-3.el7.remi php-common.x86_64 0:7.3.6-3.el7.remi php-json.x86_64 0:7.3.6-3.el7.remi

 

更新確認

# 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

 

おまけ不足のphp-mysqlを追加で導入

# yum install --enablerepo=remi,remi-php73 php-mysql
読み込んだプラグイン:fastestmirror
Loading mirror speeds from cached hostfile
 * base: ty1.mirror.newmediaexpress.com
 * extras: ty1.mirror.newmediaexpress.com
 * remi: ftp.riken.jp
 * remi-php73: ftp.riken.jp
 * remi-safe: ftp.riken.jp
 * updates: ty1.mirror.newmediaexpress.com
パッケージ php-mysql は php-mysqlnd によって不要になりました。代わりに php-mysqlnd-7.3.6-3.el7.remi.x86_64 のインストールを試みています。
依存性の解決をしています
--> トランザクションの確認を実行しています。
---> パッケージ php-mysqlnd.x86_64 0:7.3.6-3.el7.remi を インストール
--> 依存性の処理をしています: php-pdo(x86-64) = 7.3.6-3.el7.remi のパッケージ: php-mysqlnd-7.3.6-3.el7.remi.x86_64
--> トランザクションの確認を実行しています。
---> パッケージ php-pdo.x86_64 0:7.3.6-3.el7.remi を インストール
--> 依存性解決を終了しました。

依存性を解決しました

================================================================================
 Package           アーキテクチャー
                                バージョン               リポジトリー      容量
================================================================================
インストール中:
 php-mysqlnd       x86_64       7.3.6-3.el7.remi         remi-php73       232 k
依存性関連でのインストールをします:
 php-pdo           x86_64       7.3.6-3.el7.remi         remi-php73       125 k

トランザクションの要約
================================================================================
インストール  1 パッケージ (+1 個の依存関係のパッケージ)

総ダウンロード容量: 358 k
インストール容量: 1.2 M
Is this ok [y/d/N]: y
Downloading packages:
(1/2): php-pdo-7.3.6-3.el7.remi.x86_64.rpm                 | 125 kB   00:00
(2/2): php-mysqlnd-7.3.6-3.el7.remi.x86_64.rpm             | 232 kB   00:00
--------------------------------------------------------------------------------
合計                                               1.3 MB/s | 358 kB  00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  インストール中          : php-pdo-7.3.6-3.el7.remi.x86_64                 1/2
  インストール中          : php-mysqlnd-7.3.6-3.el7.remi.x86_64             2/2
  検証中                  : php-pdo-7.3.6-3.el7.remi.x86_64                 1/2
  検証中                  : php-mysqlnd-7.3.6-3.el7.remi.x86_64             2/2

インストール:
  php-mysqlnd.x86_64 0:7.3.6-3.el7.remi

依存性関連をインストールしました:
  php-pdo.x86_64 0:7.3.6-3.el7.remi

 

導入したphpを確認

# 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-mbstring-7.3.6-3.el7.remi.x86_64
php-pdo-7.3.6-3.el7.remi.x86_64
php-json-7.3.6-3.el7.remi.x86_64
php-7.3.6-3.el7.remi.x86_64
php-mysqlnd-7.3.6-3.el7.remi.x86_64

 

コメント