【问题标题】:composer not installing laravel project because of the mbstring由于 mbstring,作曲家没有安装 laravel 项目
【发布时间】:2020-10-08 06:22:26
【问题描述】:

我正在尝试通过 composer install 安装 laravel 项目,但作为回报,它给出了以下错误。

Problem 1
    - Installation request for laravel/framework v7.14.1 -> satisfiable by laravel/framework[v7.14.1].
    - laravel/framework v7.14.1 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
  Problem 2
    - Installation request for league/commonmark 1.4.3 -> satisfiable by league/commonmark[1.4.3].
    - league/commonmark 1.4.3 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
  Problem 3
    - Installation request for facade/ignition 2.0.6 -> satisfiable by facade/ignition[2.0.6].
    - facade/ignition 2.0.6 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
  Problem 4
    - Installation request for mockery/mockery 1.4.0 -> satisfiable by mockery/mockery[1.4.0].
    - mockery/mockery 1.4.0 requires php ^7.3.0 -> your PHP version (7.2.24) does not satisfy that requirement.
  Problem 5
    - Installation request for phpunit/phpunit 8.5.5 -> satisfiable by phpunit/phpunit[8.5.5].
    - phpunit/phpunit 8.5.5 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
  Problem 6
    - Installation request for scrivo/highlight.php v9.18.1.1 -> satisfiable by scrivo/highlight.php[v9.18.1.1].
    - scrivo/highlight.php v9.18.1.1 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
  Problem 7
    - laravel/framework v7.14.1 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - facade/flare-client-php 1.3.2 requires illuminate/pipeline ^5.5|^6.0|^7.0 -> satisfiable by laravel/framework[v7.14.1].
    - Installation request for facade/flare-client-php 1.3.2 -> satisfiable by facade/flare-client-php[1.3.2].

但是php72中已经安装了mbstring。首先我检查php --v 的版本,它返回了

PHP 7.2.24

然后检查加载的模块php72 -m 并且那里也没有mbstring 没有问题...之后我检查了mbstring 是否启用php72 -i | grep mbstring 并且它已启用

多字节解码支持使用 mbstring => 启用

到底为什么作曲家没有看到mbstring?我正在查看composer show -p 的模块。而且NO没有mbstring!知道为什么作曲家没有看到 mbstring,我该如何解决这个问题?

另外我在 Centos 7

【问题讨论】:

  • 您使用 php -v 检查了您的 php 版本,但随后使用 php72 测试了模块,如果您使用 php -m 测试会发生什么
  • 我已经检查过了,是的,php72 正在运行 imgur.com/a/Vr1fFgd @apokryfos

标签: laravel centos7


【解决方案1】:

日志不言自明。

laravel/framework v7.14.1 需要 ext-mbstring

league/commonmark 1.4.3 需要 ext-mbstring

外观/点火 2.0.6 需要 ext-mbstring

phpunit/phpunit 8.5.5 需要 ext-mbstring

scrivo/highlight.php v9.18.1.1 需要 ext-mbstring

试试这个命令

yum install php-mbstring

然后

作曲家更新

【讨论】:

  • 我在问题中也提到过。 mbstring 安装在 php72 上并启用。请仔细阅读。你也可以查看 php 信息 -> imgur.com/a/Vr1fFgd
  • 好的,按照本指南可能会帮助我们linuxfork.com/…
【解决方案2】:

php7.2 缺少您的 mbstring 扩展

运行sudo apt-get install -y php7.2-mbstring

编辑

此外,嘲弄/嘲弄 1.4.0 需要 php ^7.3.0。 我建议升级你的项目 php 版本。

【讨论】:

  • 我在问题中提到...为 7.2 安装并运行的 mbstring
猜你喜欢
  • 2018-10-03
  • 1970-01-01
  • 2018-12-07
  • 2017-01-07
  • 2020-06-13
  • 2014-03-04
  • 2017-05-22
  • 2017-02-14
  • 1970-01-01
相关资源
最近更新 更多