centOS 7 无法安装 php-mbstring 扩展

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/28739892/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-26 00:02:23  来源:igfitidea点击:

centOS 7 Can't install php-mbstring extension

phpunixcentosinstallmbstring

提问by KrqcS

i've tried to install the extension mbstring but i have the following error:

我尝试安装扩展 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

What could i do to resolve the problem ?

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

Thanks for your help

谢谢你的帮助

回答by KrqcS

For people who want to know how to solve this :

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

sudo yum remove php-common

Then you can:

然后你可以:

sudo yum install php-mbstring

It will automaticcaly install dependecies (php-common)

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

回答by DeamonMV

This answer from AWS Amazon forum:

这个来自 AWS Amazon 论坛的回答:

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

Then you can install php-mbstring, and maybe, I don't know exactly, but maybe it can help for servers on Amazon only.

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

回答by dotancohen

The selected answer is liable to change the installed PHP version.When not using the stock CentOS PHP, yumwill try to install the mbstringextension for the wrong version of PHP.

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

You can check yourinstalled PHP version with php -v:

您可以检查您的安装PHP版本php -v

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

Then go ahead and install the correct mbstringversion for yourinstalled PHP version:

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

$ sudo yum install php55w-mbstring

回答by hoogw

Non of above works for godaddy dedicated server centOS 6, apache 2.4, php 5.6

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

Instead, you should

相反,你应该

Install the mbstring PHP Extension with EasyApache

使用 EasyApache 安装 mbstring PHP 扩展

check if you already have it by, putty or ssh

检查你是否已经拥有它,腻子或 ssh

php -m | grep mbstring

php -m | grep 字符串

[if nothing, means missing mbstring]

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

Now you need to goto godaddy your account page,

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

click manager server,

单击管理器服务器,

open whm ----- search for apache,

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

open "easy apache 4"(my case)

打开“easy apache 4”(我的情况)

Now you need customize currently installed packages,

现在您需要自定义当前安装的软件包,

by

经过

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

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

search mbstring,

搜索 mbstring,

click on/off toggle next to it.

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

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

单击下一步,下一步,.... 优先权.. 完成。

Now you should have mbstring

现在你应该有 mbstring

by check again at putty(ssh)

通过在腻子(ssh)再次检查

php -m | grep mbstring [should see mbstring]

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

or you can find mbstring at phpinfo() page

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

回答by phe

Non of above works for godaddy dedicated server centOS 6, apache 2.4, php 5.6

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

Instead, you should install the mbstring PHP Extension with EasyApache check if you already have it by, putty or ssh

相反,您应该安装带有 EasyApache 检查的 mbstring PHP 扩展,如果您已经拥有它,腻子或 ssh

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

Now you need to go to godaddy your account page,

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

1.click manager server,

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

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

Now you need customize currently installed packages,by

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

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.

Now you should have mbstring by check again at putty(ssh)

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

php -m | grep mbstring         [should see mbstring]

or you can find mbstring at phpinfo() page

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

Thanks, my problem is done

谢谢,我的问题解决了

回答by ekerner

You must specify the same version as your php-common, mine is php70w-common

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

 sudo yum install php70w-mbstring

回答by Mark Khor

Been searching for the answer for half day, then only realise cPanel / WHM version of CentOS will disable YUM to update php. You shall remove php*from exclude list in /etc/yum.conf.

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

....

....

回答by Hassan Ali Shahzad

need to search which mbstring version required you.

需要搜索您需要哪个 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

now you can check what you actually need like i am using php7.1 so my command will be

现在你可以检查你真正需要的东西,就像我使用 php7.1 所以我的命令将是

sudo yum install ea-php71-php-mbstring

回答by V.Tran

Fedora 28 (Cloud Edition)

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

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