天天看點

yum安裝Nginx和php的最新版

一、yum安裝Nginx

  rpm -qa servicename

  解除安裝:rpm  -e --nodeps 包名

二、yum安裝php

  1、配置yum源

  追加CentOS 6.x的epel及remi源。

# rpm -Uvh http://ftp.iij.ad.jp/pub/linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm      

  添加CentOS 7.0的源

# yum install epel-release
# rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm      

  使用yum list指令檢視可安裝的包(Packege)。

# yum list --enablerepo=remi --enablerepo=remi-php56 | grep php      

  2、安裝PHP5.6

  yum源配置好了,下一步就安裝PHP5.6(包括安裝基本擴充)

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 php-ldap      

  檢視版本資訊

  # php --version

  php的優化:

#php -m|grep posix
posix