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.