php Ubuntu 16.04 缺少 mbstring 扩展

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/37743008/
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 01:21:59  来源:igfitidea点击:

Ubuntu 16.04 The mbstring extension is missing

phpmysqlubuntuphpmyadminmbstring

提问by DusanP

I want to migrate my web server from unsupported version of ubuntu 12.10. I installed 16.04 and installed apache2, php7, mysql and phpmyadmin.

我想从不受支持的 ubuntu 12.10 版本迁移我的 Web 服务器。我安装了 16.04 并安装了 apache2、php7、mysql 和 phpmyadmin。

When I want to use phpmyadmin I have error that mbstring missing.

当我想使用 phpmyadmin 时,我遇到了缺少 mbstring 的错误。

In PHP.ini file, there is only to enable this extension for windows only.

在 PHP.ini 文件中,只为 Windows 启用此扩展。

When I install mbstring package, then when I reload phpmyadmin page, I get blank page without any error.

当我安装 mbstring 包时,当我重新加载 phpmyadmin 页面时,我得到空白页面,没有任何错误。

I installed following packages:

我安装了以下软件包:

apache2, php, libapache2-mod-php, php-mysql, php-mbstring, php7.0-mbstring, mysql-server, phpmyadmin

When i uninstall mbstring packages, after phpmyadmin reload I see mbstring extension error...

当我卸载 mbstring 软件包时,在 phpmyadmin 重新加载后,我看到 mbstring 扩展错误...

What to do? I spent two days to fix this but have been unsuccessful... Thanks

该怎么办?我花了两天时间来解决这个问题,但没有成功......谢谢

回答by stadja

I found the correct way (for me) to correct it... and it's fairly simple :)

我找到了正确的方法(对我来说)来纠正它......而且它相当简单:)

Just add "universe" on the xenial-updates.

只需universexenial-updates.

# cat /etc/apt/sources.list.d/*
deb [arch=amd64] http://fr.archive.ubuntu.com/ubuntu/ xenial-backports main
deb [arch=amd64] http://fr.archive.ubuntu.com/ubuntu/ xenial main universe
deb [arch=amd64] http://fr.archive.ubuntu.com/ubuntu/ xenial-proposed main
deb [arch=amd64] http://security.ubuntu.com/ubuntu xenial-security main
deb [arch=amd64] http://fr.archive.ubuntu.com/ubuntu/ xenial-updates main universe

to do that, just

要做到这一点,只是

sudo nano /etc/apt/sources.list.d/*

and then close all the windows, except the ones with xenial-updateswhere you add universeat the end of the line!

然后关闭所有窗口,除了xenial-updatesuniverse在行尾添加的窗口!

回答by Aaron Wallentine

You could also just do this:

你也可以这样做:

sudo add-apt-repository universe

sudo add-apt-repository universe

On older versions of Ubuntu, you might have to add a full deb source line:

在旧版本的 Ubuntu 上,您可能需要添加完整的 deb 源代码行:

sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) universe"

sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) universe"

After adding the repositories, do sudo apt-get updateto update the package list.

添加存储库后,请执行sudo apt-get update更新包列表。

回答by Ishan Fernando

  1. check installed modules using; php -m in here you couldn't see mbstring module

  2. Then check the php version php -v

  3. Then install module using following command php5.6-mbstring

  4. Restart the apache server service apache2 restart

  1. 使用检查安装的模块;php -m 在这里你看不到 mbstring 模块

  2. 然后检查php版本 php -v

  3. 然后使用以下命令安装模块 php5.6-mbstring

  4. 重启apache服务器服务apache2重启

finally thats work fine.

最后那工作正常。