1.删除之前安装的PHP

yum remove php* php-common

2.安装yum源

rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

3.安装PHP7

yum clean all
yum install php70w.x86_64 php70w-cli.x86_64 php70w-common.x86_64 php70w-fpm.x86_64 php70w-gd.x86_64 php70w-mbstring.x86_64 php70w-mcrypt.x86_64 php70w-pdo.x86_64 php70w-pecl-xdebug.x86_64

4.测试一下

php -v

5.重启apache

service httpd restart

6.修改php.ini后,用下面的命令让配置生效

service php-fpm restart
04-16 10:11