【问题标题】:How to install mbstring in PHP 7.0.14?如何在 PHP 7.0.14 中安装 mbstring?
【发布时间】:2017-01-03 01:51:49
【问题描述】:

我尝试使用以下命令在 PHP 7.0.14 中安装 PHP 包 mbstring

yum install php70w-mbstring php70w-json php70w-gd php70w-mcrypt

我收到通知:

安装 4 个包(+2 个依赖包)

Total size: 2.0 M
Installed size: 13 M
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test

还有更远的错误冲突:

事务检查错误:文件 /etc/php.ini 来自安装 php70w-common-7.0.14-1.w7.x86_64 与包中的文件冲突 php70u-common-7.0.14-1.ius.centos7.x86_64 文件 /usr/lib64/php-zts/modules/bz2.so 从安装 php70w-common-7.0.14-1.w7.x86_64 与包中的文件冲突 php70u-common-7.0.14-1.ius.centos7.x86_64 文件 /usr/lib64/php/modules/bz2.so 从安装 php70w-common-7.0.14-1.w7.x86_64 与包中的文件冲突 php70u-common-7.0.14-1.ius.centos7.x86_64 文件 /usr/lib64/php-zts/modules/calendar.so 从安装 php70w-common-7.0.14-1.w7.x86_64 与包中的文件冲突 php70u-common-7.0.14-1.ius.centos7.x86_64 文件 /usr/lib64/php/modules/calendar.so 从安装 php70w-common-7.0.14-1.w7.x86_64 与包中的文件冲突 php70u-common-7.0.14-1.ius.centos7.x86_64 文件 /usr/lib64/php-zts/modules/ctype.so 从安装 php70w-common-7.0.14-1.w7.x86_64 与包中的文件冲突 php70u-common-7.0.14-1.ius.centos7.x86_64 文件 /usr/lib64/php/modules/ctype.so 从安装 php70w-common-7.0.14-1.w7.x86_64 与包中的文件冲突 php70u-common-7.0.14-1.ius.centos7.x86_64 文件 /usr/lib64/php-zts/modules/curl.so 从安装 php70w-common-7.0.14-1.w7.x86_64 与包中的文件冲突 php70u-common-7.0.14-1.ius.centos7.x86_64 文件 /usr/lib64/php/modules/curl.so 从安装 php70w-common-7.0.14-1.w7.x86_64 与包中的文件冲突 php70u-common-7.0.14-1.ius.centos7.x86_64 文件 /usr/lib64/php-zts/modules/exif.so 从安装 php70w-common-7.0.14-1.w7.x86_64 与包中的文件冲突 php70u-common-7.0.14-1.ius.centos7.x86_64 文件 /usr/lib64/php/modules/exif.so 从安装 php70w-common-7.0.14-1.w7.x86_64 与包中的文件冲突 php70u-common-7.0.14-1.ius.centos7.x86_64 文件 /usr/lib64/php-zts/modules/fileinfo.so 从安装 php70w-common-7.0.14-1.w7.x86_64 与包中的文件冲突 php70u-common-7.0.14-1.ius.centos7.x86_64 文件 /usr/lib64/php/modules/fileinfo.so 从安装 php70w-common-7.0.14-1.w7.x86_64 与包中的文件冲突 php70u-common-7.0.14-1.ius.centos7.x86_64 文件 /usr/lib64/php-zts/modules/ftp.so 从安装 php70w-common-7.0.14-1.w7.x86_64 与包中的文件冲突 php70u-common-7.0.14-1.ius.centos7.x86_64 文件 /usr/lib64/php/modules/ftp.so 从安装 php70w-common-7.0.14-1.w7.x86_64 与包中的文件冲突 php70u-common-7.0.14-1.ius.centos7.x86_64 文件 …… ...

错误总结

我用Sorry, I use CentOS Linux release 7.3.1611

如何解决这个问题并安装 mbstring?

我使用命令 yum list php7* 显示我的 PHP 版本下的所有可用包:

可用软件包名称:php70-php-mbstring Arch: x86_64 版本:7.0.14 发布:1.el7.remi 大小:524 k Repo:remi-safe 摘要:PHP 应用程序的模块 需要多字节字符串处理 URL : http://www.php.net/ 许可证:PHP 和 LGPLv2 以及 BSD 和 OpenLDAP 说明:php70-php-mbstring 包包含动态共享 将添加的对象 : 支持 PHP 的多字节字符串处理。

在我这样做之后:

yum install php70-php-mbstring

得到:

Installing:
 php70-php-mbstring                                                        x86_64                                                    7.0.14-1.el7.remi                                                     remi-safe                                                    524 k

重要说明:

Error: php70u-common conflicts with php-common-5.4.16-42.el7.x86_64
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

【问题讨论】:

    标签: php apache centos centos7


    【解决方案1】:

    您正在混合使用不同名称提供 PHP 堆栈的各种源(存储库)。这只会引发此类问题(冲突)。

    • php-* 来自基本 repo (5.4) 或“remi”(单个版本覆盖基本包,5.4、5.5、5.6、7.0 和 7.1 可用)
    • php70w-* 来自 Webtatic
    • php70u-* 来自 IUS
    • php70-php-* from "remi" (多个版本可以同时安装,在/opt)

    您应该选择一个提供商并使用其中的所有扩展。

    所以,检查安装了哪个版本,并从同一个存储库(包命名空间)中选择所有扩展

    对于“remi”存储库,您可以查看Wizard 说明。

    【讨论】:

      猜你喜欢
      • 2014-03-14
      • 2023-03-23
      • 2012-05-03
      • 2015-04-30
      • 2012-02-16
      • 2015-04-05
      • 2017-01-18
      • 2014-10-18
      相关资源
      最近更新 更多