Centos下yum安装PHP

添加 yum 源

  Centos 6.x 的源
# 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
  Centos 7.x 的源
# rpm -Uvh http://ftp.iij.ad.jp/pub/linux/fedora/epel/7/x86_64/e/epel-release-7-5.noarch.rpm 
# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm

安装 PHP

# 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

注:安装5.6版本为remi-php56,安装5.5版本为remi-php55

查看 PHP 版本

# php -v
PHP 5.6.18 (cli) (built: Feb 3 2016 10:25:33) 
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.3.3, Copyright (c) 2002-2015, by Derick Rethans

 

posted @ 2016-02-23 10:40  Jeff.Gao  阅读(792)  评论(0编辑  收藏  举报