Home  >  Q&A  >  body text

Composer error that PHP extension file information is missing from the system

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粉465675962P粉465675962337 days ago525

reply all(2)I'll reply

  • P粉702946921

    P粉7029469212023-10-19 10:56:39

    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.

    reply
    0
  • P粉277464743

    P粉2774647432023-10-19 00:34:25

    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

    reply
    0
  • Cancelreply