在centos7上安装php7的错误

时间:2015-12-08 01:40:50

标签: yum centos7 php-7

参考文件:https://webtatic.com/packages/php70/

PHP 7.0.0已于2015年12月3日在PHP.net上发布,也可通过其测试存储库中的Yum在Webtatic上获得CentOS / RHEL 6.7和7.1。

我在php7安装期间出现以下错误:

[root]# yum install php70w php70w-opcache

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.riken.jp
 * epel: ftp.riken.jp
 * extras: ftp.riken.jp
 * updates: ftp.riken.jp
 * webtatic: sp.repo.webtatic.com
Resolving Dependencies
--> Running transaction check
---> Package php70w.x86_64 0:7.0.0-1.w6 will be installed
--> Processing Dependency: php70w-common(x86-64) = 7.0.0-1.w6 for package: php70w-7.0.0-1.w6.x86_64
--> Processing Dependency: php70w-cli(x86-64) = 7.0.0-1.w6 for package: php70w-7.0.0-1.w6.x86_64
--> Processing Dependency: php70w-cli = 7.0.0-1.w6 for package: php70w-7.0.0-1.w6.x86_64
--> Processing Dependency: httpd-mmn = 20051115 for package: php70w-7.0.0-1.w6.x86_64
---> Package php70w-opcache.x86_64 0:7.0.0-1.w6 will be installed
--> Running transaction check
---> Package php70w.x86_64 0:7.0.0-1.w6 will be installed
--> Processing Dependency: httpd-mmn = 20051115 for package: php70w-7.0.0-1.w6.x86_64
---> Package php70w-cli.x86_64 0:7.0.0-1.w6 will be installed
---> Package php70w-common.x86_64 0:7.0.0-1.w6 will be installed
--> Processing Dependency: libgmp.so.3()(64bit) for package: php70w-common-7.0.0-1.w6.x86_64
--> Processing Conflict: php70w-common-7.0.0-1.w6.x86_64 conflicts php-common < 5.5.0
--> Finished Dependency Resolution
Error: Package: php70w-7.0.0-1.w6.x86_64 (webtatic)
           Requires: httpd-mmn = 20051115
           Installed: httpd-2.4.6-31.el7.centos.1.x86_64 (@updates)
               httpd-mmn = 20120211
               httpd-mmn = 20120211x8664
               httpd-mmn = 20120211-x86-64
           Available: httpd-2.4.6-31.el7.centos.x86_64 (base)
               httpd-mmn = 20120211x8664
               httpd-mmn = 20120211-x86-64
               httpd-mmn = 20120211
Error: php70w-common conflicts with php-common-5.4.16-36.el7_1.x86_64
Error: Package: php70w-common-7.0.0-1.w6.x86_64 (webtatic)
           Requires: libgmp.so.3()(64bit)
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

如何在centOS7上安装php7?

1 个答案:

答案 0 :(得分:1)

我发现依赖Remi的repos http://rpms.famillecollet.com/而不是webtatic比删除现有的包更容易/更安全 - 这也是一种有效的解决方案。

这就是为我解决的问题(挑选离你最近的镜子):

rpm -Uvh http://mirror.innosol.asia/remi/enterprise/remi-release-7.rpm
yum install php70
yum install php70-php-mysqlnd php70-php-devel php70-php-gd php70-php-mcrypt php70-php-mbstring php70-php-pear php70-php-pecl-imagick php70-php-pecl-zip

请注意,这是开发服务器

所必需的