Before the CentOS mirror of NetEase, aliyun CentOS upgrade to the latest version, has yet to begin a formal development of own projects, then upgrade all the appropriate environment to the highest.
See CentOS versions:
[root@iZ23d ~]# cat /etc/centos-release
CentOS Linux release 7.2.1511 (Core)
1、 Deleting a previous PHP version :
[root@iZ23d ~]# yum remove php* php-common
Loaded plugins: langpacks
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
No Match for argument: php-5.4.16
No Match for argument: php-5.4.16.tar.gz
No Match for 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 for argument: php-common
No Packages marked for removal
2,rpm install Php7 yum source :
[root@iZ23d ~]# rpm -Uvh https://mirr or.webtatic. com/yum/el7/ webtatic-rel ease.rpm
Retrieving https://mirr or.webtatic. com/yum/el7/ webtatic-rel ease.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, yum install PhP7 directly:
[root@iZ23d ~]# yum install php70w
Loaded plugins: langpacks
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository 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 : php70w-common-7.0.0-1.w7.x86_64 2/3
Verifying : php70w-cli-7.0.0-1.w7.x86_64 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 -v
PHP 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 ~]#
Successful installation shown above!
5, restart Apache and check phpinfo:
[root@iZ23d ~]# systemctl restart httpd.service