yum install php

1.检查当前安装的PHP包

yum list installed | grep php

如果有安装的PHP包,先删除他们

yum remove php.x86_64 php-cli.x86_64 php-common.x86_64 php-gd.x86_64 php-ldap.x86_64 php-mbstring.x86_64 php-mcrypt.x86_64 php-mysql.x86_64 php-pdo.x86_64

2.资源包

Centos 5.X

rpm -Uvh http://mirror.webtatic.com/yum/el5/latest.rpm

CentOs 6.x

rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm

CentOs 7.X

rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm

rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

3.安装PHP

yum install php56w  php56w-bcmath php56w-cli php56w-common  php56w-devel php56w-fpm    php56w-gd php56w-imap  php56w-ldap php56w-mbstring php56w-mcrypt php56w-mysql  php56w-odbc  php56w-pdo  php56w-pear  php56w-pecl-igbinary  php56w-xml php56w-xmlrpc php56w-opcache php56w-intl php56w-pecl-memcache


4.启动

/etc/init.d/php-fpm start

你可能感兴趣的:(yum install php)