標籤:php yum update
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