Composer error that PHP extension file information is missing from the system
P粉465675962
P粉465675962 2023-10-18 11:47:04
0
2
517

I'm trying to install the Laravel package intervention image and when I run composer update:

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - intervention/image 2.0.5 requires ext-fileinfo * -> the requested PHP extension fileinfo is missing from your system.
    - intervention/image 2.0.4 requires ext-fileinfo * -> the requested PHP extension fileinfo is missing from your system.
    - intervention/image 2.0.3 requires ext-fileinfo * -> the requested PHP extension fileinfo is missing from your system.
    - intervention/image 2.0.2 requires ext-fileinfo * -> the requested PHP extension fileinfo is missing from your system.
    - intervention/image 2.0.1 requires ext-fileinfo * -> the requested PHP extension fileinfo is missing from your system.
    - intervention/image 2.0.0 requires ext-fileinfo * -> the requested PHP extension fileinfo is missing from your system.
    - Installation request for intervention/image 2.* -> satisfiable by intervention/image[2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4, 2.0.5].

I have php 5.4 and have extensions enabled in php.ini and phpinfo():

fileinfo

fileinfo support                  enabled
version                           1.0.5

and restarted apache... but still no luck.

P粉465675962
P粉465675962

reply all(2)
P粉702946921

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

extension=php_fileinfo.dll

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

P粉277464743

Apparently this is because there are separate php.ini files for web/apache and CLI, and there is a problem with composer using the CLI while phpinfo() uses the main php.ini.

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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!