【问题标题】:Ubuntu 16.04 The mbstring extension is missingUbuntu 16.04 缺少 mbstring 扩展
【发布时间】:2016-10-11 02:42:29
【问题描述】:

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

当我想使用 phpmyadmin 时出现 mbstring 缺失的错误。

在 PHP.ini 文件中,只有为 windows 启用这个扩展。

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

我安装了以下软件包:

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

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

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

【问题讨论】:

标签: php mysql ubuntu phpmyadmin mbstring


【解决方案1】:

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

只需在xenial-updates 上添加“universe”即可。

# 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

要做到这一点,只需

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

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

【讨论】:

    【解决方案2】:

    你也可以这样做:

    sudo add-apt-repository universe

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

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

    添加仓库后,sudo apt-get update 更新包列表。

    【讨论】:

      【解决方案3】:
      1. 检查安装的模块使用; php -m 在这里你看不到 mbstring 模块

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

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

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

      终于可以正常工作了。

      【讨论】:

        【解决方案4】:

        安装php7.0-mbstring模块后,需要重启apache2才能生效:sudo apachectl graceful

        【讨论】:

          猜你喜欢
          • 2018-02-20
          • 2016-03-01
          • 2018-12-11
          • 1970-01-01
          • 2016-05-12
          • 2018-08-11
          • 2018-05-22
          • 2020-11-19
          相关资源
          最近更新 更多