I\'m trying to install Laravel package Intervention Image and when I run composer update
:
Your requirements could not be resolved to an installa
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.
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.
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
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.
I have the same problem. Fixed now.
you can also uncomment this line
extension=php_fileinfo.dll
in the following files:
php.ini-development
php.ini-production
Please don't forget to restart
your Apache.
Hope this will help.
On Windows I had to add line extension=php_fileinfo.dll
in my php.ini file