安装 composer 时出现 fileinfo 相关错误

今天尝试着配置了一下 php 的运行环境,在安装 composer 后执行 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 intervention/image 2.4.2 -> satisfiable by intervention/image[2.4.2].
    - intervention/image 2.4.2 requires ext-fileinfo * -> the requested PHP extension fileinfo is missing from your system.
  Problem 2
    - Installation request for league/flysystem 1.0.49 -> satisfiable by league/flysystem[1.0.49].
    - league/flysystem 1.0.49 requires ext-fileinfo * -> the requested PHP extension fileinfo is missing from your system.
  Problem 3
    - league/flysystem 1.0.49 requires ext-fileinfo * -> the requested PHP extension fileinfo is missing from your system.
    - laravel/framework v5.5.44 requires league/flysystem ^1.0.8 -> satisfiable by league/flysystem[1.0.49].
    - Installation request for laravel/framework v5.5.44 -> satisfiable by laravel/framework[v5.5.44].

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

经尝试,在 php.ini 中的 [ExtensionList] 加上 extension=php_fileinfo.dll 就可以正常运行了。

发表评论

电子邮件地址不会被公开。 必填项已用*标注