歡迎訪問 www.zhizhi123.com,匯聚WEB開發知識
php
默認的版本過低了,手動安裝有一些麻煩,想採用Yum安裝的能夠使用下面的方案:
html
1.檢查當前安裝的PHP包java
yum list installed | grep phpmysql
若是有安裝的PHP包,先刪除他們web
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_64sql
2.Centos 5.Xphp7
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.X
rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpmspa
若是想刪除上面安裝的包,從新安裝
rpm -qa | grep webstatic
rpm -e 上面搜索到的包便可
3.運行yum install.net
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_64
orm
yum 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就能夠了。
yum install php70w.x86_64 php70w-cli.x86_64 php70w-common.x86_64 php70w-gd.x86_64 php70w-ldap.x86_64 php70w-mbstring.x86_64 php70w-mcrypt.x86_64 php70w-mysql.x86_64 php70w-pdo.x86_64
4.安裝PHP FPM
yum install php55w-fpm
yum install php56w-fpm
yum install php70w-fpm
注:若是想升級到5.6把上面的55w換成56w就能夠了。
轉自:
http://www.blogjava.net/nkjava/archive/2015/01/20/422289.html