【问题标题】:Laravel Error Composer UpdateLaravel 错误编辑器更新
【发布时间】:2018-11-06 17:59:51
【问题描述】:
user@user:/opt/lampp/htdocs/gitrepo$ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - laravel/framework v5.6.1 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.6.0 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework 5.6.x-dev requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - Installation request for laravel/framework 5.6.* -> satisfiable by laravel/framework[5.6.x-dev, v5.6.0, v5.6.1, v5.6.10, v5.6.11, v5.6.12, v5.6.13, v5.6.14, v5.6.15, v5.6.16, v5.6.17, v5.6.18, v5.6.19, v5.6.2, v5.6.20, v5.6.21, v5.6.22, v5.6.23, v5.6.3, v5.6.4, v5.6.5, v5.6.6, v5.6.7, v5.6.8, v5.6.9].

  To enable extensions, verify that they are enabled in those .ini files:
    - /etc/php/7.1/cli/php.ini
    - /etc/php/7.1/cli/conf.d/10-opcache.ini
    - /etc/php/7.1/cli/conf.d/10-pdo.ini
    - /etc/php/7.1/cli/conf.d/15-xml.ini
    - /etc/php/7.1/cli/conf.d/20-calendar.ini
    - /etc/php/7.1/cli/conf.d/20-ctype.ini
    - /etc/php/7.1/cli/conf.d/20-dom.ini
    - /etc/php/7.1/cli/conf.d/20-exif.ini
    - /etc/php/7.1/cli/conf.d/20-fileinfo.ini
    - /etc/php/7.1/cli/conf.d/20-ftp.ini
    - /etc/php/7.1/cli/conf.d/20-gettext.ini
    - /etc/php/7.1/cli/conf.d/20-iconv.ini
    - /etc/php/7.1/cli/conf.d/20-json.ini
    - /etc/php/7.1/cli/conf.d/20-phar.ini
    - /etc/php/7.1/cli/conf.d/20-posix.ini
    - /etc/php/7.1/cli/conf.d/20-readline.ini
    - /etc/php/7.1/cli/conf.d/20-shmop.ini
    - /etc/php/7.1/cli/conf.d/20-simplexml.ini
    - /etc/php/7.1/cli/conf.d/20-sockets.ini
    - /etc/php/7.1/cli/conf.d/20-sysvmsg.ini
    - /etc/php/7.1/cli/conf.d/20-sysvsem.ini
    - /etc/php/7.1/cli/conf.d/20-sysvshm.ini
    - /etc/php/7.1/cli/conf.d/20-tokenizer.ini
    - /etc/php/7.1/cli/conf.d/20-wddx.ini
    - /etc/php/7.1/cli/conf.d/20-xmlreader.ini
    - /etc/php/7.1/cli/conf.d/20-xmlwriter.ini
    - /etc/php/7.1/cli/conf.d/20-xsl.ini
  You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode

当我尝试更新作曲家时收到此错误。什么解决方案可以解决它?我已经安装了 php7.1,我也安装了 composer (sudo apt-get install composer)

【问题讨论】:

  • 消息很清楚:“requires ext-mbstring * -> 系统中缺少请求的 PHP 扩展 mbstring。” 安装请求的 PHP 扩展 mbstring
  • 我已经完成了 sudo apt-get install php-mbstring php7.1-mbstring 和 sudo apt-get install php-mbstring php7.0-mbstring
  • 我遇到了另一个问题
  • 确保为 laravel 启用所有必需的扩展。

标签: php laravel


【解决方案1】:
composer install --ignore-platform-reqs \
composer update --ignore-platform-reqs

【讨论】:

  • 虽然此代码可能会解决问题,但 including an explanation 关于如何以及为什么解决问题将真正有助于提高您的帖子质量,并可能导致更多的赞成票。请记住,您正在为将来的读者回答问题,而不仅仅是现在提问的人。请edit您的答案添加解释并说明适用的限制和假设。
  • 另外,请解释一下这可能会产生严重的后果 - 如果应用程序需要给定的扩展程序才能正常运行怎么办?你真的要忽略它吗?
【解决方案2】:

取消注释后,php.ini file 中的上述扩展名和作曲家无法正常工作。如果遇到以下错误,则需要取消注释php.ini file 中的一些其他扩展。

// Error on the terminal when I ran: composer install

Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for league/flysystem 1.0.64 -> satisfiable by league/flysystem[1.0.64].
    - league/flysystem 1.0.64 requires ext-fileinfo * -> the requested PHP extension fileinfo is missing from your system.
  Problem 2
    - league/flysystem 1.0.64 requires ext-fileinfo * -> the requested PHP extension fileinfo is missing from your system.
    - laravel/framework v6.14.0 requires league/flysystem ^1.0.8 -> satisfiable by league/flysystem[1.0.64].
    - Installation request for laravel/framework v6.14.0 -> satisfiable by laravel/framework[v6.14.0].

  To enable extensions, verify that they are enabled in your .ini files:
    - C:\PHP7\php.ini
  You can also run `php --ini` inside terminal to see which files are used by PHP in CLI 
mode.

由于this resource 和others 没有提到PHP7.4 的安装,但您仍然可以关注它们。在我取消注释为mentioned in this article 之后。您还需要取消注释

extension=fileinfo
extension=mbstring // probabily this too

【讨论】:

  • 您好。您能否澄清“此解决方案可能无法解决所提出的问题”的意思?如果它根本没有回答问题,则不应将其作为答案发布。它只是针对不同扩展的答案吗?如果是这样,那可能已经足够接近以至于不需要提及差异。
  • 已解决,感谢您的关注
【解决方案3】:

您的包需要一些目前无法找到的依赖项。尝试以下命令并更新作曲家,然后,

sudo apt-get install php7.1-mbstring
sudo service apache2 restart
composer update

【讨论】:

    【解决方案4】:

    由于错误消息“您的系统缺少请求的 PHP 扩展 mbstring。”表明您的系统缺少 PHP 扩展 mbstring。

    如果您安装了apt/apt-get,您可以使用搜索扩展名

    apt search php7.1-mbstring
    

    要安装它,请使用:

    sudo apt install php7.1-mbstring
    

    【讨论】:

    • 我得到这个 php7.1-mbstring 已经是最新版本 (7.1.17-1+ubuntu16.04.1+deb.sury.org+1)。
    • "要启用扩展,请确认它们已在这些 .ini 文件中启用:" 是否已启用?你有文件/etc/php/7.1/cli/conf.d/20-mbstring.ini吗?
    猜你喜欢
    • 1970-01-01
    • 2019-03-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-09-21
    • 1970-01-01
    相关资源
    最近更新 更多