CentOS6 PHP5.4 up PHP5.6 升級紀錄

up

公司有一台Linode主機 最近因為有免費升級,所以就趁著Proxy移轉到Azure測試的這這段時間升級一下。
原本的方案是 4核心、8G記憶體、4000G流量、96G空間。
升級後4核心、8G記憶體、5000G流量(in+out)、160G空間
沒錯流量和空間變大了,費用一樣是每個月40美金。 (不過我想再降低一些)。
因為現在Proxy圖量的沒有那個多了。 降低費用節省開銷

如何升級?
首先先查一下目前php的版本

# php -v

PHP 5.4.35 (cli) (built: Nov 14 2014 07:04:10)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
    with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2015, by Zend Technologies

更新一下yum 清單

$ rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm
Retrieving https://mirror.webtatic.com/yum/el6/latest.rpm
warning: /var/tmp/rpm-tmp.SlcVnI: Header V4 DSA/SHA1 Signature, key ID cf4c4ff9: NOKEY
Preparing...                ########################################### [100%]
   1:webtatic-release       ########################################### [100%]

接下來移除php

$ yum remove php-common
Loaded plugins: fastestmirror, priorities
Setting up Remove Process
Resolving Dependencies
--> Running transaction check
---> Package php-common.x86_64 0:5.4.45-15.el6.remi will be erased
中間生省略
Transaction Summary
==========================================================================================================
Remove       15 Package(s)

Installed size: 31 M
Is this ok [y/N]: y
按Y確定執行移除php

YUM安裝PHP5.6

$ yum install -y php56w php56w-opcache php56w-xml php56w-mcrypt php56w-gd php56w-devel php56w-mysql php56w-intl php56w-mbstring
Loaded plugins: fastestmirror, priorities
Setting up Install Process
Loading mirror speeds from cached hostfile
中間省略
Installed:
  php56w.x86_64 0:5.6.37-1.w6                          php56w-devel.x86_64 0:5.6.37-1.w6                  
  php56w-gd.x86_64 0:5.6.37-1.w6                       php56w-intl.x86_64 0:5.6.37-1.w6                   
  php56w-mbstring.x86_64 0:5.6.37-1.w6                 php56w-mcrypt.x86_64 0:5.6.37-1.w6                 
  php56w-mysql.x86_64 0:5.6.37-1.w6                    php56w-opcache.x86_64 0:5.6.37-1.w6                
  php56w-xml.x86_64 0:5.6.37-1.w6                     

Dependency Installed:
  apr.x86_64 0:1.3.9-5.el6_9.1                           apr-util.x86_64 0:1.3.9-3.el6_0.1                
  apr-util-ldap.x86_64 0:1.3.9-3.el6_0.1                 httpd.x86_64 0:2.2.15-69.el6.centos              
  httpd-tools.x86_64 0:2.2.15-69.el6.centos              libicu.x86_64 0:4.2.1-14.el6                     
  libmcrypt.x86_64 0:2.5.8-9.el6                         libtool-ltdl.x86_64 0:2.2.6-15.5.el6             
  php56w-cli.x86_64 0:5.6.37-1.w6                        php56w-common.x86_64 0:5.6.37-1.w6               
  php56w-pdo.x86_64 0:5.6.37-1.w6                       

$ /etc/init.d/httpd restart       (重啟服務)

$ php -v
PHP 5.6.37 (cli) (built: Jul 20 2018 18:40:47)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies

檢查PHP5.6 已經安裝完畢,重啟開機測試一下

參考文章的出處與來源  :可以按這邊

About dfoneuser