Centos 6.x/7.x yum安裝php5.6.X(最新版)

來源:互聯網
上載者:User

標籤:zend   logs   開始   pac   let   x86_64   bst   mon   使用   

鑒於Centos 預設yum源的php版本太低了,手動編譯安裝又有點一些麻煩,那麼如何採用Yum安裝的方案安裝最新版呢。那麼,今天我們就來學習下如何用yum安裝php最新版。

1.檢查當前安裝的PHP包

yum list installed | grep php  

如果有安裝的PHP包,先刪除他們

yum remove php.x86_64 php-cli.x86_64 php-common.x86_64 php-gd.x86_64 php-ldap.x86_64 php-mbstring.x86_64 php-mcrypt.x86_64 php-mysql.x86_64 php-pdo.x86_64  
配置yum源

追加CentOS 6.5的epel及remi源。

# rpm -Uvh http://ftp.iij.ad.jp/pub/linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

以下是CentOS 7.0的源。

# yum install epel-release# rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm

使用yum list命令查看可安裝的包(Packege)。

# yum list --enablerepo=remi --enablerepo=remi-php56 | grep php
安裝PHP5.6.x

yum源配置好了,下一步就安裝PHP5.6。

# yum install --enablerepo=remi --enablerepo=remi-php56 php php-opcache php-devel php-mbstring php-mcrypt php-mysqlnd php-phpunit-PHPUnit php-pecl-xdebug php-pecl-xhprof php-gd php-redis
安裝PHP-fpm
yum install --enablerepo=remi --enablerepo=remi-php56 php-fpm 

在這裡安裝的版本是PHP5.6.13。

從PHP5.5開始PHP代碼緩衝從APC變成了Zend OPcache了。

其他源:

 

2.Centos 5.X
  rpm -Uvh http://mirror.webtatic.com/yum/el5/latest.rpm  CentOs 6.x  rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm  CentOs 7.Xrpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpmrpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

如果想刪除上面安裝的包,重新安裝
rpm -qa | grep webstatic
rpm -e  上面搜尋到的包即可

3.運行yum install

yum install php55w.x86_64 php55w-cli.x86_64 php55w-common.x86_64 php55w-gd.x86_64 php55w-ldap.x86_64 php55w-mbstring.x86_64 php55w-mcrypt.x86_64 php55w-mysql.x86_64 php55w-pdo.x86_64yum install php56w.x86_64 php56w-cli.x86_64 php56w-common.x86_64 php56w-gd.x86_64 php56w-ldap.x86_64 php56w-mbstring.x86_64 php56w-mcrypt.x86_64 php56w-mysql.x86_64 php56w-pdo.x86_64

註:如果想升級到5.6把上面的55w換成56w就可以了。
4.安裝PHP FPM

yum install php55w-fpm
註:如果想升級到5.6把上面的55w換成56w就可以了。

Centos 6.x/7.x yum安裝php5.6.X(最新版)

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.