RHEL 6.xはデフォルトのrepoではPHP 5.3までになります。
サブスクリプション(保守契約)を購入していない、あるいは契約によって追加のRedHat repoが利用できない場合はphp 5.4以降にアップグレードすることができません。
しかしphp 5.3は既にEnd of lifeになっています。
PHP Supported Versions
http://php.net/supported-versions.php
保守契約をしていればセキュリティ関連だけでも修正版を提供してくれると思いますが、どうなるか分かりません。
そこでこの際だからremi repoで提供されているphp 5.6に入れ替えてみました。
【検証環境】
・Red Hat Enterprise Linux Server release 6.8 (Santiago)
・Kernel: 2.6.32-642.el6.x86_64
・PHP 5.3.3 (cli) (built: Dec 15 2015 04:52:58)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
php-xml-5.3.3-47.el6.x86_64
php-common-5.3.3-47.el6.x86_64
php-pear-1.9.4-5.el6.noarch
php-cli-5.3.3-47.el6.x86_64
php-gd-5.3.3-47.el6.x86_64
php-pdo-5.3.3-47.el6.x86_64
php-5.3.3-47.el6.x86_64
- Install epel,remi repo
- Uninstall php 5.3
- Install PHP 5.6
- 確認
remi repoを利用するためにはepel repoが必要です。
今後継続して利用するので[remi],[remi-php56]がenabled=0になっているのでenabled=1に変更しました。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# rpm -ivh https://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm Retrieving https://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm warning: /var/tmp/rpm-tmp.2HZFrI: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY Preparing... ########################################### [100%] 1:epel-release ########################################### [100%] # cat /etc/yum.repos.d/epel.repo [epel] name=Extra Packages for Enterprise Linux 6 - $basearch #baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch failovermethod=priority enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6 (snip) # rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm Retrieving http://rpms.famillecollet.com/enterprise/remi-release-6.rpm warning: /var/tmp/rpm-tmp.rYB4o9: Header V4 DSA/SHA1 Signature, key ID 00f97f56: NOKEY Preparing... ########################################### [100%] 1:remi-release ########################################### [100%] # cat /etc/yum.repos.d/remi.repo [remi] name=Remi's RPM repository for Enterprise Linux 6 - $basearch #baseurl=http://rpms.remirepo.net/enterprise/6/remi/$basearch/ mirrorlist=http://rpms.remirepo.net/enterprise/6/remi/mirror enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi (snip) [remi-php56] name=Remi's PHP 5.6 RPM repository for Enterprise Linux 6 - $basearch #baseurl=http://rpms.remirepo.net/enterprise/6/php56/$basearch/ mirrorlist=http://rpms.remirepo.net/enterprise/6/php56/mirror # NOTICE: common dependencies are in "remi-safe" enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi (snip) |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# yum remove php-* Loaded plugins: product-id, search-disabled-repos, security, subscription-manager This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register Setting up Remove Process Resolving Dependencies --> Running transaction check ---> Package php.x86_64 0:5.3.3-47.el6 will be erased ---> Package php-cli.x86_64 0:5.3.3-47.el6 will be erased ---> Package php-common.x86_64 0:5.3.3-47.el6 will be erased ---> Package php-gd.x86_64 0:5.3.3-47.el6 will be erased ---> Package php-pdo.x86_64 0:5.3.3-47.el6 will be erased ---> Package php-pear.noarch 1:1.9.4-5.el6 will be erased ---> Package php-xml.x86_64 0:5.3.3-47.el6 will be erased --> Finished Dependency Resolution Dependencies Resolved ============================================================================================================== Package Arch Version Repository Siz ============================================================================================================== Removing: php x86_64 5.3.3-47.el6 @anaconda-RedHatEnterpriseLinux-201604140956.x86_64/6.8 3.5 php-cli x86_64 5.3.3-47.el6 @anaconda-RedHatEnterpriseLinux-201604140956.x86_64/6.8 6.2 php-common x86_64 5.3.3-47.el6 @anaconda-RedHatEnterpriseLinux-201604140956.x86_64/6.8 2.9 php-gd x86_64 5.3.3-47.el6 @anaconda-RedHatEnterpriseLinux-201604140956.x86_64/6.8 324 php-pdo x86_64 5.3.3-47.el6 @anaconda-RedHatEnterpriseLinux-201604140956.x86_64/6.8 168 php-pear noarch 1:1.9.4-5.el6 @anaconda-RedHatEnterpriseLinux-201604140956.x86_64/6.8 2.2 php-xml x86_64 5.3.3-47.el6 @anaconda-RedHatEnterpriseLinux-201604140956.x86_64/6.8 307 Transaction Summary ============================================================================================================== Remove 7 Package(s) Installed size: 16 M Is this ok [y/N]: y Downloading Packages: Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Warning: RPMDB altered outside of yum. Erasing : php-5.3.3-47.el6.x86_64 1/ Erasing : 1:php-pear-1.9.4-5.el6.noarch 2/ Erasing : php-cli-5.3.3-47.el6.x86_64 3/ Erasing : php-xml-5.3.3-47.el6.x86_64 4/ Erasing : php-pdo-5.3.3-47.el6.x86_64 5/ Erasing : php-gd-5.3.3-47.el6.x86_64 6/ Erasing : php-common-5.3.3-47.el6.x86_64 7/ Verifying : php-5.3.3-47.el6.x86_64 1/ Verifying : php-gd-5.3.3-47.el6.x86_64 2/ Verifying : php-cli-5.3.3-47.el6.x86_64 3/ Verifying : php-pdo-5.3.3-47.el6.x86_64 4/ Verifying : php-common-5.3.3-47.el6.x86_64 5/ Verifying : 1:php-pear-1.9.4-5.el6.noarch 6/ Verifying : php-xml-5.3.3-47.el6.x86_64 7/ Removed: php.x86_64 0:5.3.3-47.el6 php-cli.x86_64 0:5.3.3-47.el6 php-common.x86_64 0:5.3.3-47.el6 php-gd.x86_64 0:5.3.3-47.el6 php-pdo.x86_64 0:5.3.3-47.el6 php-pear.noarch 1:1.9.4-5.el6 php-xml.x86_64 0:5.3.3-47.el6 Complete! |
php-gdのインストールでエラーになりました。
1 2 3 4 5 6 7 |
---> Package php-gd.x86_64 0:5.6.27-1.el6.remi will be installed --> Processing Dependency: libt1.so.5()(64bit) for package: php-gd-5.6.27-1.el6.remi.x86_64 --> Finished Dependency Resolution Error: Package: php-gd-5.6.27-1.el6.remi.x86_64 (remi-php56) Requires: libt1.so.5()(64bit) You could try using --skip-broken to work around the problem You could try running: rpm -Va --nofiles --nodigest |
調べたらt1lib-*が必要なので先にインストールします。これはInstall DVDにあるものをインストールしました。
1 |
# rpm -ivh t1lib-5.1.2-6.el6_2.1.x86_64.rpm |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 |
# yum install php php-devel php-mbstring php-pdo php-gd php-mysqlnd Loaded plugins: product-id, search-disabled-repos, security, subscription-manager This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register. Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package php.x86_64 0:5.6.27-1.el6.remi will be installed --> Processing Dependency: php-common(x86-64) = 5.6.27-1.el6.remi for package: php-5.6.27-1.el6.remi.x86_64 --> Processing Dependency: php-cli(x86-64) = 5.6.27-1.el6.remi for package: php-5.6.27-1.el6.remi.x86_64 ---> Package php-devel.x86_64 0:5.6.27-1.el6.remi will be installed --> Processing Dependency: php-pecl-jsonc-devel(x86-64) for package: php-devel-5.6.27-1.el6.remi.x86_64 ---> Package php-gd.x86_64 0:5.6.27-1.el6.remi will be installed ---> Package php-mbstring.x86_64 0:5.6.27-1.el6.remi will be installed ---> Package php-mysqlnd.x86_64 0:5.6.27-1.el6.remi will be installed ---> Package php-pdo.x86_64 0:5.6.27-1.el6.remi will be installed --> Running transaction check ---> Package php-cli.x86_64 0:5.6.27-1.el6.remi will be installed ---> Package php-common.x86_64 0:5.6.27-1.el6.remi will be installed --> Processing Dependency: php-pecl-zip(x86-64) for package: php-common-5.6.27-1.el6.remi.x86_64 --> Processing Dependency: php-pecl-jsonc(x86-64) for package: php-common-5.6.27-1.el6.remi.x86_64 ---> Package php-pecl-jsonc-devel.x86_64 0:1.3.10-1.el6.remi.5.6 will be installed --> Running transaction check ---> Package php-pecl-jsonc.x86_64 0:1.3.10-1.el6.remi.5.6 will be installed ---> Package php-pecl-zip.x86_64 0:1.13.5-1.el6.remi.5.6 will be installed --> Finished Dependency Resolution Dependencies Resolved ============================================================================================================== Package Arch Version Repository Size ============================================================================================================== Installing: php x86_64 5.6.27-1.el6.remi remi-php56 2.7 M php-devel x86_64 5.6.27-1.el6.remi remi-php56 1.2 M php-gd x86_64 5.6.27-1.el6.remi remi-php56 78 k php-mbstring x86_64 5.6.27-1.el6.remi remi-php56 968 k php-mysqlnd x86_64 5.6.27-1.el6.remi remi-php56 276 k php-pdo x86_64 5.6.27-1.el6.remi remi-php56 118 k Installing for dependencies: php-cli x86_64 5.6.27-1.el6.remi remi-php56 4.0 M php-common x86_64 5.6.27-1.el6.remi remi-php56 1.1 M php-pecl-jsonc x86_64 1.3.10-1.el6.remi.5.6 remi-php56 51 k php-pecl-jsonc-devel x86_64 1.3.10-1.el6.remi.5.6 remi-php56 31 k php-pecl-zip x86_64 1.13.5-1.el6.remi.5.6 remi-php56 52 k Transaction Summary ============================================================================================================== Install 11 Package(s) Total download size: 10 M Installed size: 42 M Is this ok [y/N]: y Downloading Packages: (1/11): php-5.6.27-1.el6.remi.x86_64.rpm | 2.7 MB 00:16 (2/11): php-cli-5.6.27-1.el6.remi.x86_64.rpm | 4.0 MB 00:29 (3/11): php-common-5.6.27-1.el6.remi.x86_64.rpm | 1.1 MB 00:06 (4/11): php-devel-5.6.27-1.el6.remi.x86_64.rpm | 1.2 MB 00:09 (5/11): php-gd-5.6.27-1.el6.remi.x86_64.rpm | 78 kB 00:01 (6/11): php-mbstring-5.6.27-1.el6.remi.x86_64.rpm | 968 kB 00:08 (7/11): php-mysqlnd-5.6.27-1.el6.remi.x86_64.rpm | 276 kB 00:03 (8/11): php-pdo-5.6.27-1.el6.remi.x86_64.rpm | 118 kB 00:01 (9/11): php-pecl-jsonc-1.3.10-1.el6.remi.5.6.x86_64.rpm | 51 kB 00:00 (10/11): php-pecl-jsonc-devel-1.3.10-1.el6.remi.5.6.x86_64.rpm | 31 kB 00:00 (11/11): php-pecl-zip-1.13.5-1.el6.remi.5.6.x86_64.rpm | 52 kB 00:00 -------------------------------------------------------------------------------------------------------------- Total 126 kB/s | 10 MB 01:25 Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Installing : php-pecl-zip-1.13.5-1.el6.remi.5.6.x86_64 1/11 WARNING : These php-* RPMs are not official Fedora / Red Hat build and overrides the official ones. Don't file bugs on Fedora Project nor Red Hat. Use dedicated forum at http://forum.remirepo.net/ Installing : php-common-5.6.27-1.el6.remi.x86_64 2/11 Installing : php-pecl-jsonc-1.3.10-1.el6.remi.5.6.x86_64 3/11 Installing : php-cli-5.6.27-1.el6.remi.x86_64 4/11 Installing : php-pecl-jsonc-devel-1.3.10-1.el6.remi.5.6.x86_64 5/11 Installing : php-devel-5.6.27-1.el6.remi.x86_64 6/11 Installing : php-pdo-5.6.27-1.el6.remi.x86_64 7/11 Installing : php-mysqlnd-5.6.27-1.el6.remi.x86_64 8/11 Installing : php-5.6.27-1.el6.remi.x86_64 9/11 Installing : php-mbstring-5.6.27-1.el6.remi.x86_64 10/11 Installing : php-gd-5.6.27-1.el6.remi.x86_64 11/11 Verifying : php-pecl-jsonc-1.3.10-1.el6.remi.5.6.x86_64 1/11 Verifying : php-pecl-jsonc-devel-1.3.10-1.el6.remi.5.6.x86_64 2/11 Verifying : php-5.6.27-1.el6.remi.x86_64 3/11 Verifying : php-cli-5.6.27-1.el6.remi.x86_64 4/11 Verifying : php-mbstring-5.6.27-1.el6.remi.x86_64 5/11 Verifying : php-gd-5.6.27-1.el6.remi.x86_64 6/11 Verifying : php-pdo-5.6.27-1.el6.remi.x86_64 7/11 Verifying : php-devel-5.6.27-1.el6.remi.x86_64 8/11 Verifying : php-pecl-zip-1.13.5-1.el6.remi.5.6.x86_64 9/11 Verifying : php-mysqlnd-5.6.27-1.el6.remi.x86_64 10/11 Verifying : php-common-5.6.27-1.el6.remi.x86_64 11/11 Installed: php.x86_64 0:5.6.27-1.el6.remi php-devel.x86_64 0:5.6.27-1.el6.remi php-gd.x86_64 0:5.6.27-1.el6.remi php-mbstring.x86_64 0:5.6.27-1.el6.remi php-mysqlnd.x86_64 0:5.6.27-1.el6.remi php-pdo.x86_64 0:5.6.27-1.el6.remi Dependency Installed: php-cli.x86_64 0:5.6.27-1.el6.remi php-common.x86_64 0:5.6.27-1.el6.remi php-pecl-jsonc.x86_64 0:1.3.10-1.el6.remi.5.6 php-pecl-jsonc-devel.x86_64 0:1.3.10-1.el6.remi.5.6 php-pecl-zip.x86_64 0:1.13.5-1.el6.remi.5.6 Complete! # rpm -qa | grep php | sort php-5.6.27-1.el6.remi.x86_64 php-cli-5.6.27-1.el6.remi.x86_64 php-common-5.6.27-1.el6.remi.x86_64 php-devel-5.6.27-1.el6.remi.x86_64 php-gd-5.6.27-1.el6.remi.x86_64 php-mbstring-5.6.27-1.el6.remi.x86_64 php-mysqlnd-5.6.27-1.el6.remi.x86_64 php-pdo-5.6.27-1.el6.remi.x86_64 php-pecl-jsonc-1.3.10-1.el6.remi.5.6.x86_64 php-pecl-jsonc-devel-1.3.10-1.el6.remi.5.6.x86_64 php-pecl-zip-1.13.5-1.el6.remi.5.6.x86_64 |
あとは必要に応じてインストールして下さい。
/etc/php.iniのdate.timezone = Asia/Tokyoを追加して動作確認を行って下さい。
1 2 3 4 |
# php -v PHP 5.6.27 (cli) (built: Oct 14 2016 14:06:54) Copyright (c) 1997-2016 The PHP Group Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies |
問題は無いと思いますが自己責任で。