I have ext-fileinfo but Composer says it is missing

前端 未结 9 1578
旧时难觅i
旧时难觅i 2020-12-03 05:12

I\'m trying to install Laravel package Intervention Image and when I run composer update:

Your requirements could not be resolved to an installa         


        
相关标签:
9条回答
  • 2020-12-03 05:25

    Windows users: just edit php.ini and uncomment this line:

    extension=php_fileinfo.dll
    

    Remember to restart Apache for new php.ini to take effect.

    0 讨论(0)
  • 2020-12-03 05:25

    Uncomment extension=php_fileinfo.dll in php ini configuration files (php.ini-development if needed) And then if you're using XAMPP, use the apache shell. It can be loaded from XAMPP Control panel run php -m to verfy that extention is loaded. Then run composer install.

    0 讨论(0)
  • 2020-12-03 05:26

    Apparently it is because there are separate php.ini files for web/apache and CLI and as composer uses the CLI and phpinfo() uses the main php.ini the problem occurs.

    If you run php -m in CLI and don't see the module's name you should find the CLI php.ini (in my case php-cli.ini and add the extension. e.g. extension=php_fileinfo.dll

    0 讨论(0)
  • 2020-12-03 05:27

    For me it was different using php 7.4.x and Windows 10.

    I checked which php.ini file is used by PHP in CLI mode with php --ini.

    It showed C:\php7\php.ini - where I previously unzipped PHP (and also pointed Composer there).

    Then I needed to uncomment extension=fileinfo in that file.

    0 讨论(0)
  • 2020-12-03 05:30

    I have the same problem. Fixed now.
    you can also uncomment this line

    extension=php_fileinfo.dll  
    

    in the following files:

    1. php.ini-development
    2. php.ini-production

    Please don't forget to restart your Apache.
    Hope this will help.

    0 讨论(0)
  • 2020-12-03 05:31

    On Windows I had to add line extension=php_fileinfo.dll in my php.ini file

    0 讨论(0)
提交回复
热议问题