CentOS6 php5.3 upgrade php5.4 and Active bcmath

先昇到  php5.4

PHP Current VersionCentOS 7.0-1406CentOS 6.6

5.6.45.4.165.3.3

現在我們可以利用另一個Linux發行版本Fedora的project來改善PHP版本問題。我們需要補充兩個Repos。首先我們需要EPEL 再來需要Remi 。

Repo設置

先確認您的伺服器已經打開SSH通道,然後執行下面指令(您需要有執行指令的權限,如果有必要建議使用root操作,或是sudo):

在CentOS 7下(包含安裝EPEL)

wget https://dl.fedoraproject.org/pub/epel/ ... el-release-7-5.noarch.rpm

wget https://rpms.famillecollet.com/enterprise/remi-release-7.rpm rpm -Uvh remi-release-7*.rpm epel-release-7*.rpm

如果您原本就已經裝過EPEL則執行下面指令:

wget https://rpms.famillecollet.com/enterprise/remi-release-7.rpm

rpm -Uvh remi-release-7*.rpm

 

在CentOS 6下(包含安裝EPEL)

wget https://dl.fedoraproject.org/pub/epel/ xxx

點連結找. 因為會一直變 https://dl.fedoraproject.org/pub/epel/

wget https://rpms.famillecollet.com/enterprise/remi-release-6.rpm

rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm

 

如果您原本就已經裝過EPEL則執行下面指令:

wget https://rpms.famillecollet.com/enterprise/remi-release-6.rpm

rpm -Uvh remi-release-6*.rpm

 

啟動程式庫(Repo,repository)

進行到目前為止,我們需要確認程式庫有被啟動,同時選訂我們想要安裝的版本。 We need to head over to /etc/yum.repos.d you should inside see a file called remi.repo.

使用您喜好的編輯器(Nano、Pico、Vi ...etc)開啟remi.repo這隻檔案,您將看到一部份參數。我們需要確認第一階段[remi]是啟用狀態。

[remi] name=Les RPM de remi pour Enterprise Linux 6 - $basearch

#baseurl=https://rpms.famillecollet.com/enterprise/6/remi/$basearch/

mirrorlist=https://rpms.famillecollet.com/enterprise/6/remi/mirror

enabled=1

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi

這一行enabled=1確認要設定!在技術上現在是可以繼續進行PHP安裝,但是將只會取得PHP 5.4.X版本。這如果不是你要的,那麼跳到下一步驟!

 

Installing PHP

 yum install php php-gd php-mysql php-mcrypt

 

完成之後才可以install  php5.4-bcmath

yum install php-bcmath  完成後

 yum install php54-php-bcmath.x86_64
 

所以感覺.如果你是昇級...  兩版本都必須要上

 

its done

 

← 回列表