CentOS Install the latest version of PHP

Source: Internet
Author: User
Tags zend

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 &nbsp: php70w-7.0.0-1.w7.x86_64                                    1/3   Verifying &nbsp: ph p70w-common-7.0.0-1.w7.x86_64                           & nbsp  2/3   Verifying &nbsp: 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


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.