View CentOS Version:
[root@iz23d ~]# cat/etc/centos-release
CentOS Linux release 7.2.1511 (Core)
1, delete the previous version of PHP:
[root@iz23d ~]# yum remove php* php-common Loaded plugins:langpacks Repository Base is listed more than E in the configuration Repository updates are listed more than once in the configuration Repository extras are listed more T Han once in the configuration Repository Centosplus are listed more than once in the configuration No Match for Argument:p hp-5.4.16 no match for argument:php-5.4.16.tar.gz no match to Argument:php-7.0.1rc1 no match for ARGUMENT:PHP-7.0.1RC1 . tar.gz no match for argument:phpmyadmin-4.4.0.tar.gz no match to Argument:php-common no Packages marked for removal
2,RPM installation PHP7 the corresponding Yum source: [root@iz23d ~]#RPM-UVH https://mirror.webtatic.com/yum/el7/webtatic-release.rpmRetrieving https://mirror.webtatic.com/yum/el7/webtatic-release.rpm Warning:/var/tmp/rpm-tmp. Lhjkkr:header V4 rsa/sha1 Signature, key ID 62e74ca5:nokey preparing ... ####################### ########## [100%] Package Webtatic-release-7-3.noarch is already installed
3,Direct Yum Installation PHP7: [root@iz23d ~]#Yum Install php70w Loaded plugins:langpacks Repository Base is listed other than once in the configuration Repository upd Ates is listed more than once in the configuration Repository extras are listed more than once in the configuration Ory Centosplus is listed more than once in the configuration resolving dependencies--> Running Transaction Check ... "omitted" Warning:rpmdb altered outside of Yum. installing:php70w-common-7.0.0-1.w7.x86_64  1/3 installing:php70w-cli-7.0.0-1.w7.x86_64 2/3 installing:php70w-7.0.0-1.w7.x86 _64 3/3 Verifying  : php70w-7.0.0-1.w7.x86_64 1/3 Verifying  : ph p70w-common-7.0.0-1.w7.x86_64 & nbsp  2/3 Verifying  : php70w-cli-7.0.0-1.w7.x86_64 &N Bsp 3/3 installed: php70w. x86_64 0:7.0.0-1.w7 Dependency installed:php70w-cli. x86_64 0:7.0.0-1.w7 php70w-common.x86_64 0:7.0.0-1.w7 complete!
4,Check the PHP version: [root@iz23d ~]#php-vPHP 7.0.0 (CLI) (Built:dec 2 2015 20:42:32) (NTS) Copyright (c) 1997-2015 the PHP Group Zend Engine v3.0.0, copyright (c) 1998-2015 Zend Technologies [ROOT@IZ23D2E6HOQZ ~]# above display installation success. 5, restart Apache, view phpinfo: [root@iz23d ~]# systemctl Restart Httpd.service