centos7.2自带的php5.4升级为5.6
参考:http://jingyan.baidu.com/article/380abd0a1f176c1d91192c4b.html
-
今天在新购的阿里云上部署个phpmyadmin,结果显示了个如下信息:
PHP 5.5+ is required.
Currently installed version is: 5.4.16
系统是centos7.2,phpmyadmin的版本是4.6.5.2最新,降版本的妥协方法不是自己的性格,在参考一番资料后部署正常,记录如下。 -
进入终端后查看php版本:php -v
输出可能如下:
PHP 5.4.35 (cli) (built: Nov 14 2014 07:04:10) Copyright (c) 1997-2014 The PHP Group Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2015, by Zend Technologies
-
rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
-
yum remove php-common
然后像安装那样问你是否继续的,输入yes即可
-
yum install -y php56w php56w-opcache php56w-xml php56w-mcrypt php56w-gd php56w-devel php56w-mysql php56w-intl php56w-mbstring
-
service httpd restart
查看最新的版本
php -v
现在应该是5.6了!
-
Php网站运行不正常,发现上面遗漏
yum install -y php56w-fpm
service php-fpm start
service nginx restart
Ok, 网站正常运行起来啦