10

我尝试安装扩展 mbstring,但出现以下错误:

    Error: Package: php-mbstring-5.4.16-23.el7_0.3.x86_64 (updates)
        Requires: php-common(x86-64) = 5.4.16-23.el7_0.3
        Installed: php-common-5.4.38-1.el7.remi.x86_64 (@remi)
        php-common(x86-64) = 5.4.38-1.el7.remi
        Available: php-common-5.4.16-21.el7.x86_64 (base)
        php-common(x86-64) = 5.4.16-21.el7
        Available: php-common-5.4.16-23.el7_0.x86_64 (updates)
        php-common(x86-64) = 5.4.16-23.el7_0
        Available: php-common-5.4.16-23.el7_0.1.x86_64 (updates)
        php-common(x86-64) = 5.4.16-23.el7_0.1
        Available: php-common-5.4.16-23.el7_0.3.x86_64 (updates)
        php-common(x86-64) = 5.4.16-23.el7_0.3
    You could try using --skip-broken to work around the problem
    You could try running: rpm -Va --nofiles --nodigest

我能做些什么来解决这个问题?

谢谢你的帮助

4

9 回答 9

20

对于想知道如何解决这个问题的人:

sudo yum remove php-common

那么你也能:

sudo yum install php-mbstring

它将自动安装依赖项(php-common)

于 2015-02-26T10:32:00.143 回答
15

这个来自 AWS 亚马逊论坛的答案:

yum -y install yum-utils
yum repolist all
yum-config-manager --enable rhui-REGION-rhel-server-extras rhui-REGION-rhel-server-optional

然后你可以安装php-mbstring,也许,我不知道确切,但也许它只对亚马逊上的服务器有帮助。

于 2015-08-29T08:35:02.593 回答
7

所选答案可能会更改已安装的 PHP 版本。当不使用库存的 CentOS PHP 时,yum会尝试mbstring为错误版本的 PHP 安装扩展。

可以使用以下命令检查已安装的 PHP 版本php -v

$ php -v
PHP 5.5.36 (cli) (built: May 28 2016 12:05:32)

然后继续mbstring安装的 PHP 版本安装正确的版本:

$ sudo yum install php55w-mbstring
于 2016-06-08T14:30:42.127 回答
6

需要搜索哪个 mbstring 版本需要你。

cat /etc/redhat-release && php -v && yum search mbstring



========================================================================= N/S matched: mbstring ==========================================================================
ea-php54-php-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling
ea-php55-php-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling
ea-php56-php-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling
ea-php70-php-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling
ea-php71-php-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling
ea-php72-php-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling
ea-php73-php-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling

现在您可以检查您实际需要的内容,就像我使用 php7.1 一样,所以我的命令将是

sudo yum install ea-php71-php-mbstring
于 2019-06-21T20:04:19.723 回答
5

您必须指定与您的 php-common 相同的版本,我的是 php70w-common

 sudo yum install php70w-mbstring
于 2018-05-19T17:40:17.343 回答
5

以上不适用于 godaddy 专用服务器 centOS 6、apache 2.4、php 5.6

相反,你应该

使用 EasyApache 安装 mbstring PHP 扩展

检查您是否已经通过 putty 或 ssh 拥有它

php -m | grep mbstring

[如果没有,意味着缺少 mbstring]

现在你需要去godaddy你的账户页面,

点击管理服务器,

打开whm-----搜索apache,

打开“easy apache 4”(我的案例)

现在你需要自定义当前安装的包,

经过

单击“当前安装的软件包...”旁边的顶行上的“自定义”按钮

搜索mbstring,

单击它旁边的开/关切换。

单击下一步,下一步,.... privision..done。

现在你应该有 mbstring

通过 putty(ssh) 再次检查

php -m | grep mbstring [应该看到 mbstring]

或者你可以在 phpinfo() 页面找到 mbstring

于 2018-07-19T23:02:02.367 回答
4

以上不适用于 godaddy 专用服务器 centOS 6、apache 2.4、php 5.6

相反,您应该使用 EasyApache 检查您是否已经通过 putty 或 ssh 安装了 mbstring PHP 扩展

php -m | grep mbstring       [if nothing, means missing mbstring]

现在你需要去godaddy你的账户页面,

1.click manager server,

2.open whm ----- search for apache,

3.open "easy apache 4"(my case)

现在你需要自定义当前安装的包,通过

4.click "customize" button on top line next to "currently installed package..."

5.In the search bar write "mbstring",

6.click on/off toggle next to it.

7.click next, next, .... privision..done.

现在你应该通过 putty(ssh) 再次检查来获得 mbstring

php -m | grep mbstring         [should see mbstring]

或者你可以在 phpinfo() 页面找到 mbstring

谢谢,我的问题解决了

于 2019-02-15T08:25:36.877 回答
4

找了半天的答案,才发现cPanel/WHM版本的CentOS会禁用YUM更新php。您应从 中php*的排除列表中删除/etc/yum.conf

……

于 2015-07-22T10:38:30.070 回答
2

Fedora 28(云版)

sudo yum install php56-php-mbstring
sudo yum install php70-php-mbstring
sudo yum install php71-php-mbstring
sudo yum install php72-php-mbstring
sudo yum install php73-php-mbstring

于 2019-11-25T10:21:42.933 回答