CentOS 通過yum來升級php到php5.6

來源:互聯網
上載者:User

標籤:pre   ase   find   3.0   htm   環境   .com   too   nsf   

 

1.查看已經安裝的php版本號碼

鍵入下面代碼:

php -v或者/usr/bin/php

出現下面代碼: 

PHP 5.3.3 (cli) (built: Jul 9 2015 17:39:00)Copyright (c) 1997-2010 The PHP GroupZend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies

 

2.安裝Remi跟EPEL RPM源

下載並安裝,代碼如下: 

wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm && rpm -Uvh epel-release-latest-6.noarch.rpmwget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm && rpm -Uvh remi-release-6*.rpm

 

下載之後:

vim /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/mirrorenabled=1gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi

 

還有以下:

[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# WARNING: If you enable this repository, you must also enable "remi"enabled=1gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi

 

3.現在可以yum命令直接升級了

 輸入以下代碼

yum -y upgrade php*
大概是鏡像問題。我得到了報錯

Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist http://rpms.remirepo.net/enterprise/6/php55/mirror error was
12: Timeout on http://rpms.remirepo.net/enterprise/6/php55/mirror: (28, ‘Operation too slow. Less than 1 bytes/sec transfered the last 30 seconds‘)
錯誤:Cannot find a valid baseurl for repo: remi-php55

 

然後我yum update -y php*就好了    -_-無奈!

 

一旦更新完畢,再次查看php版本號碼 

php -v

 

出現以下資訊 

 
PHP 5.6.30 (cli) (built: Jan 19 2017 08:09:42) Copyright (c) 1997-2016 The PHP GroupZend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies

 

 到此,php升級完畢

 

ref:http://www.cnblogs.com/insoleis/articles/5587630.html

CentOS 通過yum來升級php到php5.6

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.