php5.3升级到php5.6
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php5.3升级到php5.6相关的知识,希望对你有一定的参考价值。
centos默认系统安装的是php5.3
[[email protected] scripts]# rpm -qa |grep php
php-pdo-5.3.3-47.el6.x86_64
php-mysql-5.3.3-47.el6.x86_64
php-5.3.3-47.el6.x86_64
php-cli-5.3.3-47.el6.x86_64
php-common-5.3.3-47.el6.x86_64
卸载
rpm -e php-mysql-5.3.3-48.el6_8.x86_64
rpm -e php-bcmath-5.3.3-48.el6_8.x86_64
rpm -e php-5.3.3-48.el6_8.x86_64
rpm -e php-common-5.3.3-48.el6_8.x86_64
rpm -e php-common-* #依赖包过多用yum卸载
yum -y remove php-common-*
安装php5.6.25
rpm -Uvh http://download.Fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
yum install --enablerepo=remi,remi-php56 php php-opcache php-pecl-apcu php-devel php-mbstring php-mcrypt php-mysqlnd php-phpunit-PHPUnit php-pecl-xdebug php-pecl-xhprof php-pdo php-pear php-fpm php-cli php-xml php-bcmath php-process php-gd php-common
[[email protected] scripts]# php -v
PHP 5.6.25 (cli) (built: Aug 31 2016 19:26:19)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
with Xdebug v2.4.1, Copyright (c) 2002-2016, by Derick Rethans
ps:有时候会出现phpinfo()打印和php -v显示的不是一个版本,如果是刚更新的要解决这个问题需要重启apache服务即可。
以上是关于php5.3升级到php5.6的主要内容,如果未能解决你的问题,请参考以下文章
如何在CentOS 6.7上将PHP 5.3升级到PHP 5.6