環境中安裝過php 5.4,覺得版本太低了,因此刪除舊版本安裝了新版本
1. 安裝epel-release
通過命令:
rpm -ivh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-9.noarch.rpm
(這個大家可以訪問http://dl.fedoraproject.org/pub/epel/7/x86_64/e/ 目錄,下載epel-release-XXX.noarch.rpm的最新版本)
成功安裝。
2. 安裝PHP7
終端再次運行如下命令:
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
成功獲取PHP7的yum源,然后再執行:
yum install php70w
執行報錯:
Resolving Dependencies
--> Running transaction check
---> Package php70w.x86_64 0:7.0.20-1.w6 will be installed
--> Processing Dependency: php70w-common(x86-64) = 7.0.20-1.w6 for package: php70w-7.0.20-1.w6.x86_64
--> Processing Dependency: php70w-cli(x86-64) = 7.0.20-1.w6 for package: php70w-7.0.20-1.w6.x86_64
--> Processing Dependency: php70w-cli = 7.0.20-1.w6 for package: php70w-7.0.20-1.w6.x86_64
--> Processing Dependency: httpd-mmn = 20051115 for package: php70w-7.0.20-1.w6.x86_64
--> Running transaction check
---> Package php70w.x86_64 0:7.0.20-1.w6 will be installed
--> Processing Dependency: httpd-mmn = 20051115 for package: php70w-7.0.20-1.w6.x86_64
---> Package php70w-cli.x86_64 0:7.0.20-1.w6 will be installed
---> Package php70w-common.x86_64 0:7.0.20-1.w6 will be installed
--> Processing Dependency: libgmp.so.3()(64bit) for package: php70w-common-7.0.20-1.w6.x86_64
--> Finished Dependency Resolution
Error: Package: php70w-common-7.0.20-1.w6.x86_64 (webtatic)
Requires: libgmp.so.3()(64bit)
Error: Package: php70w-7.0.20-1.w6.x86_64 (webtatic)
Requires: httpd-mmn = 20051115
Installed: httpd-2.4.6-45.el7.centos.4.x86_64 (@updates)
httpd-mmn = 20120211
httpd-mmn = 20120211x8664
httpd-mmn = 20120211-x86-64
Available: httpd-2.4.6-45.el7.centos.x86_64 (base)
httpd-mmn = 20120211x8664
httpd-mmn = 20120211-x86-64
httpd-mmn = 20120211
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
執行yum clean all 清除緩存后,
再次執行
yum install php70w
安裝成功~