CentOS7 installation PHP7.0

Source: Internet
Author: User
Tags centos
In Centos7, the PHP7 is installed via Yum, which is first run at the terminal:

You need to install Epel-release first.

1. Install Epel-release
by command:
Yum-y Install Epel-release

Successfully installed.


2. Install PHP7

Centos/rhel 7.x:

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
1 2

If it is CENTOS6, then execute the following code:
Centos/rhel 6.x:

RPM-UVH https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
RPM-UVH https:// mirror.webtatic.com/yum/el6/latest.rpm
1 2 successfully acquires the Yum source of the PHP7 and then executes:
Yum Install php70w

Then you can directly yum install php7.0, you can install the expansion as follows:

Yum install Php70w-common php70w-fpm php70w-opcache php70w-gd php70w-mysqlnd php70w-mbstring Php70w-pecl-redis Php70w-pecl-memcached Php70w-devel

With this command, you can install the following extensions.

Php-api, php-bz2, Php-calendar, Php-ctype, Php-curl, Php-date, Php-exif, Php-fileinfo, Php-filter, Php-ftp, Php-gettext, Php-gmp, Php-hash, Php-iconv, Php-json, Php-libxml, Php-openssl, Php-pcre, Php-pecl-fileinfo, Php-pecl-phar, Php-pecl-zip, Php-reflection, Php-session, Php-shmop, Php-simplexml, Php-sockets, PHP-SPL, Php-tokenizer, Php-zend-abi , Php-zip, Php-zlib 3. Verifying installation

Displays the current PHP version,

Php-v

Check out PHP Extensions:

Php-m
Uninstall PHP

First Use yum remove PHP, after the completion of the execution php-v can still prompt version number, indicating that the uninstallation was unsuccessful.

Then use the rpm uninstall try Rpm-qa|grep php, the completion of the implementation of PHP-V version of the information is still.

Finally using the Yum remove Php-common, the version information is finally gone, uninstall completed.

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.