linux下使用yum安裝新版php7.0

這兩天又裝了一下虛擬機,又要編譯lnmp,還要弄各類拓展,很麻煩,能不能直接yum安裝呢?答案是能夠的!php

一、首先要更新yum源,否則是默認的老版本,通常都在5.6及如下,可是php7都出來很久了,性能提高50%以上!mysql

按照系統更新yum源,個人是centos7,因此我運行下面的代碼!web

CentOS/RHEL 7.x:redis

rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

若是是centos6,那麼執行如下代碼: 
CentOS/RHEL 6.x:sql

rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm

而後就能夠直接yum安裝php7.0了,能夠安裝的拓展以下:mongodb

yum install php70w-common php70w-fpm php70w-opcache php70w-gd php70w-mysqlnd php70w-mbstring php70w-pecl-redis php70w-pecl-memcached php70w-devel

就這一條命令,就能夠安裝了下面的拓展了!json

php-api, php-bz2, php-calendar, php-ctype, php-curl, php-date, php-exif, php-fileinfo, php-filter, php-ftp, php-gettext, php-gmp, php-hash, php-iconv, php-json, php-libxml, php-openssl, php-pcre, php-pecl-Fileinfo, php-pecl-phar, php-pecl-zip, php-reflection, php-session, php-shmop, php-simplexml, php-sockets, php-spl, php-tokenizer, php-zend-abi, php-zip, php-zlibcentos

激動吧?別急,還有更牛的!通常都要安裝memcached,gd,mysql,等等是吧?api

 1 安裝包         提供的拓展
 2 php70w          mod_php , php70w-zts
 3 php70w-bcmath       
 4 php70w-cli      php-cgi, php-pcntl, php-readline
 5 php70w-common   php-api, php-bz2, php-calendar, php-ctype, php-curl, php-date, php-exif, php-fileinfo, php-filter, php-ftp, php-gettext, php-gmp, php-hash, php-iconv, php-json, php-libxml, php-openssl, php-pcre, php-pecl-Fileinfo, php-pecl-phar, php-pecl-zip, php-reflection, php-session, php-shmop, php-simplexml   , php-sockets, php-spl, php-tokenizer, php-zend-abi, php-zip, php-zlib
 6 php70w-dba      
 7 php70w-devel        
 8 php70w-embedded     php-embedded-devel
 9 php70w-enchant      
10 php70w-fpm      
11 php70w-gd       
12 php70w-imap     
13 php70w-interbase        php_database, php-firebird
14 php70w-intl     
15 php70w-ldap     
16 php70w-mbstring     
17 php70w-mcrypt       
18 php70w-mysql        php-mysqli, php_database
19 php70w-mysqlnd      php-mysqli, php_database
20 php70w-odbc     php-pdo_odbc, php_database
21 php70w-opcache      php70w-pecl-zendopcache
22 php70w-pdo      php70w-pdo_sqlite, php70w-sqlite3
23 php70w-pdo_dblib        php70w-mssql
24 php70w-pear     
25 php70w-pecl-apcu    
26 php70w-pecl-imagick 
27 php70w-pecl-memcached   
28 php70w-pecl-mongodb 
29 php70w-pecl-redis   
30 php70w-pecl-xdebug  
31 php70w-pgsql        php-pdo_pgsql, php_database
32 php70w-phpdbg       
33 php70w-process      php-posix, php-sysvmsg, php-sysvsem, php-sysvshm
34 php70w-pspell       
35 php70w-recode       
36 php70w-snmp     
37 php70w-soap     
38 php70w-tidy     
39 php70w-xml      php-dom, php-domxml, php-wddx, php-xsl
40 php70w-xmlrpc   

譬如你要加裝xml,那麼能夠直接,別懷疑就是這麼簡單:session

yum install php70w-xml

二、檢驗一下成果:

查看一下php版本:

php -v

 

查看一下php拓展:

看到了吧?基本上會用的拓展都齊了吧?要啥本身去yum一下就行了!不再用去糾結各類依賴問題了!

相關文章
相關標籤/搜索