Check the PHP version after entering the terminal
PHP – V
the output may be as follows:
PHP 5.4.35 (CLI) (build: Nov 14 2014 07:04:10) Copyright (c) 1997-2014 the PHP group Zend engine v2.6.0, copyright (c) 1998-2015 Zend technologies with Zend opcache v7.0.4-dev, Copyright (c) 1999-2015, by Zend technologiesExecute the following command to upgrade the software warehouse
rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpmExecute the following command to delete PHP (pay attention to the packages unloaded when unloading)
Yum remove PHP commonThen ask you if you want to continue like the installation, enter yes to
install PHP 5.6 (php56w devel is not required) (you can use Yum search php56w to check the missing dependent packages)
Yum install – y php56w php56w opcache php56w XML php56w mcrypt php56w GD php56w devel php56w MySQL php56w Intl php56w mbstring php56w FPMRestart httpd
Service httpd restart
view the latest version
PHP – V
now it should be 5.6!
solution:
so, through the following three steps, delete the 7 version of EPEL, and then install the appropriate version of epel6:
1. Yum remove EPEL release
2. RM – RF/var/cache/Yum/x86_ 64/6/epel/*
3.rpm – Uvhhttp://mirrors.ustc.edu.cn/epel/epel-release-latest-6.noarch.rpm
4.rpm – Uvhhttp://mirror.webtatic.com/yum/el6/latest.rpm
Execute the installation command to install php7 again, and this error is still prompted. Most of the solutions to search on the Internet are the same as above, and the problems have not been effectively solved after repeated operations.
After carefully reading the error prompt, the content is “XZ compression is not available”, XZ is a compression tool, and my system is minimal installation, it should be that this tool is not installed.
Next, perform the following steps to install XZ:
Yum clean all
Yum – y install XZ
rpm- Uvhhttp://mirror.webtatic.com/yum/el6/latest.rpm
Then execute Yum install – y php7 success!
Similar Posts:
- [Solved] PHP Compile error: error adding symbols: DSO missing from command line
- [Solved] Yum makecache Error: Error: Cannot retrieve repository metadata (repomd.xml)
- Can’t find PHP headers in /usr/include/php The php-devel package is required for use of this command.
- [How to Solve] Centos 14: problem making ssl connection
- [Solved] Centos6: Python 2.6 upgrade to 3.7, error handling [no module named ‘_ctypes’]
- [Solved] php -v Error: error while loading shared libraries: libonig.so.5:cannot open share directory
- Yum installer reported an error: nothing to do [How to Solve]
- Centos6 upgrades glibc-2.17 to solve requirements: libc. So. 6 (glibc)_ 2.14) (64bit) error resolution
- How to Enable EPEL Repository for CentOS 7.x/6.x/5.x
- [Solved] Cannot retrieve metalink for repository: epel