【问题标题】:Trying to install Laravel using composer and it says "the requested PHP extension fileinfo is missing from your system"尝试使用 composer 安装 Laravel,它说“您的系统缺少请求的 PHP 扩展文件信息”
【发布时间】:2022-02-03 20:53:51
【问题描述】:
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.1.3 -> satisfiable by league/flysystem[1.1.3].
    - league/flysystem 1.1.3 requires ext-fileinfo * -> the requested PHP extension fileinfo is missing from your system.
  Problem 2
    - Installation request for league/mime-type-detection 1.4.0 -> satisfiable by league/mime-type-detection[1.4.0].
    - league/mime-type-detection 1.4.0 requires ext-fileinfo * -> the requested PHP extension fileinfo is missing from your system.
  Problem 3
    - league/flysystem 1.1.3 requires ext-fileinfo * -> the requested PHP extension fileinfo is missing from your system.
    - laravel/framework v7.26.1 requires league/flysystem ^1.0.34 -> satisfiable by league/flysystem[1.1.3].
    - Installation request for laravel/framework v7.26.1 -> satisfiable by laravel/framework[v7.26.1].

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

【问题讨论】:

标签: laravel composer-php


【解决方案1】:

您已从 php.ini 禁用 fileinfo 扩展。要启用扩展,请验证在 .ini 文件中已启用(在 C:\xampp\php\php.ini 中查找/添加行“extension=fileinfo”)。 您也可以在终端内运行php --ini,以查看 PHP 在 CLI 模式下使用了哪些文件。

【讨论】:

    【解决方案2】:

    首先,停止 XAMPP/Wamp,然后请从您的 xampp\php\php.ini 中删除起始分号 ( ; ),然后执行以下代码。

    ;extension=fileinfo
    

    extension=fileinfo
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-04-15
      • 2022-01-19
      • 2015-12-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-12-07
      相关资源
      最近更新 更多