【问题标题】:Composer telling me mbstring is missing on my server, but it is installed enabled - ideas?作曲家告诉我 mbstring 在我的服务器上丢失,但它已启用 - 想法?
【发布时间】:2018-02-06 18:04:53
【问题描述】:

我使用 Ubunto 14 在 digitalocean 上运行 laravel 5.3 站点。

运行 composer 安装包时出现此错误:

“您的系统中缺少请求的 PHP 扩展 mbstring。”

问题是,它已经启用,由 phpinfo 确认:

mbstring
Multibyte Support   enabled
Multibyte string engine libmbfl
HTTP input encoding translation disabled
libmbfl version 1.3.2
oniguruma version   5.9.6

因为我已经运行了 php7.0,所以我尝试过

sudo apt-get install php7.0-mbstring

但它告诉我

php7.0-mbstring is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.

在这里真的很茫然。想法?也许我需要重新安装 PHP?作曲家在哪里查看是否安装了扩展?为什么它不会看到 phpinfo 返回的相同信息?

谢谢, 布赖恩

【问题讨论】:

  • 在你的服务器上运行sudo apt-get install php-mbstring 命令
  • 可能已安装但未启用,您可以查看您的php.ini。
  • 检查是否在 cli 和 web 服务器 php.ini 文件中都启用了它
  • 在终端上运行php -v 会得到什么输出?以及它在 phpinfo 上显示的内容?也许你有不同的php版本。
  • 请检查您的 php 配置文件。也许你必须在 php.ini 中添加一行“extension=php7.0-mbstring.so”。请看:askubuntu.com/questions/491629/…

标签: php laravel ubuntu mbstring


【解决方案1】:

基本上,您需要在您的服务器中安装php-mbstring。

sudo apt-get install php-mbstring 

您需要使用以下命令安装特定的php 版本:

sudo apt-get install phpx.x-mbstring

希望这行得通!

【讨论】:

    猜你喜欢
    • 2015-12-26
    • 2020-07-18
    • 2014-07-15
    • 2017-12-29
    • 2017-07-08
    • 2019-09-01
    • 1970-01-01
    • 1970-01-01
    • 2021-09-01
    相关资源
    最近更新 更多