php versionup php

1
[root@cnserver4 ~]# rpm -qa | grep php
php-5.3.3-27.el6_5.x86_64
php-mysql-5.3.3-27.el6_5.x86_64

2
[root@cnserver4 ~]# yum info php
Loaded plugins: fastestmirror security
Determining fastest mirrors

3
[root@cnserver4 ~]# cat /etc/yum.repos.d
cat: /etc/yum.repos.d: Is a directory
[root@cnserver4 ~]#

4
[root@cnserver4 ~]# yum repolist all
Loaded plugins: fastestmirror security
Loading mirror speeds from cached hostfile
5
[root@cnserver4 ~]# cat /etc/redhat-release
CentOS release 6.3 (Final)
[root@cnserver4 ~]#
[root@cnserver4 ~]#
[root@cnserver4 ~]#

6
[root@cnserver4 ~]# rpm -qa | grep epel
[root@cnserver4 ~]# rpm -qa | grep remi
[root@cnserver4 ~]#
[root@cnserver4 ~]# cat /etc/yum.repos.d/epel.repo
cat: /etc/yum.repos.d/epel.repo: No such file or directory
[root@cnserver4 ~]#
[root@cnserver4 ~]#
[root@cnserver4 ~]# ls /etc/yum.repos.d/CentOS-Base.repo
/etc/yum.repos.d/CentOS-Base.repo
[root@cnserver4 ~]#


7
[root@cnserver4 ~]# rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
Retrieving http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
warning: /var/tmp/rpm-tmp.BwWKhw: Header V3 RSA/SHA256 Signature key ID 0608b895: NOKEY
Preparing... ########################################### [100%]
1:epel-release ########################################### [100%]
[root@cnserver4 ~]#

[root@cnserver4 ~]# 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.fkYXu8: Header V4 DSA/SHA1 Signature key ID 00f97f56: NOKEY
Preparing... ########################################### [100%]
1:remi-release ########################################### [100%]
[root@cnserver4 ~]#



8
編集
vi /etc/yum.repos.d/epel.repo

[root@cnserver4 ~]# vi /etc/yum.repos.d/epel.repo
[root@cnserver4 ~]# head -10 /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=0 ←★ 0 に編集する
gpgcheck=1

一応バックアップ
cp /etc/php.ini /home/php.ini

既存のphpを削除
[root@cnserver4 ~]# yum remove php*
Loaded plugins: fastestmirror security
Setting up Remove Process
Resolving Dependencies

[root@cnserver4 ~]#
[root@cnserver4 ~]# php -v
-bash: php: command not found
[root@cnserver4 ~]#

9
[root@cnserver4 ~]# yum --enablerepo=epel remi info php  ★エラーになるが調べるだけだし
cn5 だとOKだった

Loaded plugins: fastestmirror security
Loading mirror speeds from cached hostfile

Cannot retrieve metalink for repository: epel. Please verify its path and try again
[root@cnserver4 ~]#


10 これを先
yum install --enablerepo=epel libwebp
yum install --enablerepo=remi gd-last


11
[root@cnserver4 ~]#
[root@cnserver4 ~]# yum install php php-common --enablerepo=remi remi-php56
Loaded plugins: fastestmirror security
Loading mirror speeds from cached hostfile
* base: ftp.tsukuba.wide.ad.jp
* extras: ftp.tsukuba.wide.ad.jp
* rem


-----------------
ようやく次

# yum install php-mysqlnd php-mbstring php-gd php-pdo php-gd php-xml --enablerepo=remi remi-php56

# yum install libmcrypt --enablerepo=epel


# yum install php-mcrypt --enablerepo=remi remi-php56
12
#
sudo service httpd restart

# 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 Copyri

http://qiita.com/zaburo/items/fd67b294c610d54c3aee
http://d.hatena.ne.jp/C_6B4A2B/20130427/1367073209