17

So I am following the tutorial on tuts+ Premium from Jeffrey Way - Creating an Ecommerce App in Laravel 4 and I am stuck with this problem. He is installing a package by just editing the composer.json file with this line "intervention/image": "dev-master" and then just types 'composer update' into his console. I try the same but it won't work.

It displays this error

" Problem 1 - intervention/image 2.0.2 requires ext-fileinfo * -> the requested PHP exte nsion fileinfo is missing from your system. - intervention/image 2.0.1 requires ext-fileinfo * -> the requested PHP exte nsion fileinfo is missing from your system. - intervention/image 2.0.0 requires ext-fileinfo * -> the requested PHP exte nsion fileinfo is missing from your system. - Installation request for intervention/image 2.* -> satisfiable by interven tion/image[2.0.0, 2.0.1, 2.0.2]."

I have tried following their instructions on http://image.intervention.io/getting_started/installation but it wouldn't work.

I don't know how to handle this issue. Please help. I also read somewhere that I should edit the php.ini file and uncomment a line for fileinfo but after restarting Apache again it did not work.

I am using Windows 8 with wamp and Laravel.

Any help would be appreciated greatly.

Deveram
  • 460
  • 2
  • 7
  • 24

5 Answers5

47

Make sure that, you have php_fileinfo.dll is installed/available in your php\ext folder and also make sure that, the following line is not commented in php.ini file:

extension=php_fileinfo.dll

If it's commented like this:

;extension=php_fileinfo.dll

Then just remove that ; from the beginning of the line and then restart the wamp/apache server.

Update:

However, some web servers are confusing because they do not use the php.ini located alongside your PHP executable. To find out where your actual php.ini resides, look for its path in phpinfo():

After activating an extension, save php.ini, restart the web server and check phpinfo() again. The new extension should now have its own section.

Also check the Installing a PHP extension on Windows (Resolving problems) on PHP manual.

The Alpha
  • 143,660
  • 29
  • 287
  • 307
  • php_fileinfo.dll is in my php/ext folder in wamp and also that line is uncommented as I said before: " I also read somewhere that I should edit the php.ini file and uncomment a line for fileinfo but after restarting Apache again it did not work." Thanks for being willing to help. I appreciate it. – Deveram Jun 08 '14 at 19:59
  • 1
    If it's available in the `ext` folder and also not commented in `php.ini` file then it should be installed, make sure you restarted the apache server, or maybe just restart the system. – The Alpha Jun 08 '14 at 20:02
  • 1
    As can be seen on these 2 links, the line is uncommented http://www.dodaj.rs/f/2g/aS/2UaVmzd1/snip.jpg and the file is in my ext folder http://www.dodaj.rs/f/1r/AL/Xb3sF8V/snip2.jpg I tried restarting the PC but it just won't work - same error message. I don't know what else to do :/ – Deveram Jun 08 '14 at 20:21
  • Can you run `phpinfo();` and find out the path for `php.ini` file that is being used. – The Alpha Jun 08 '14 at 20:25
  • Run it in the console? (If so it just ignores the command) the php.ini file I edited is the one I got when clicking on the wamp icon in the bottom right toolbar of windows and selecting PHP and php.ini – Deveram Jun 08 '14 at 20:30
  • 1
    You may run the `phpinfo()` function from a `php` script, just create a `php` file, i.e. `htdocs/info.php` and write ``, then navigate this file using `localhost/info.php` from browser. each extension should have it's own section. – The Alpha Jun 08 '14 at 20:35
  • The phpinfo() statement shows that the ini file used is from: C:\wamp\bin\apache\apache2.4.4\bin\php.ini. I checked if the lines that should be uncommented in the file are uncommented and they are. So the php_fileinfo.dll is uncommented in C:\wamp\bin\apache\apache2.4.4\bin\php.ini – Deveram Jun 08 '14 at 20:41
  • 1
    Thank you Alpha, it works on me, when I uncomment "extension=fileinfo" using Wnmp as local web server on a Laravel project. – Two Jan 04 '21 at 10:46
5

There are 2 php.ini files:

wamp\bin\php\php5.4.3\php.ini
wamp\bin\apache\Apache2.4.4\bin\php.ini

Make sure the extension is uncommented in both, then restart apache.

GTCrais
  • 2,039
  • 2
  • 26
  • 32
3

I had this problem. The trouble is that the php.ini file that Apache uses is different than the CLI one. Just search for php.ini in your wamp folder and change it in all of the files...

Andrew
  • 91
  • 1
  • 2
1

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

see: Composer: The requested PHP extension ext-intl * is missing from your system

Community
  • 1
  • 1
Positivity
  • 5,406
  • 6
  • 41
  • 61
0

for me I just inserted in the list because i cannot find it [ extension=php_fileinfo.dll ] after [ExtensionList]

[ExtensionList]

**extension=php_fileinfo.dll**<br>
extension=php_mysqli.dll<br>
extension=php_mbstring.dll<br>
extension=php_gd2.dll<br>
extension=php_gettext.dll<br>
extension=php_curl.dll<br>
extension=php_exif.dll<br>
extension=php_xmlrpc.dll<br>
extension=php_openssl.dll<br>
extension=php_soap.dll<br>
extension=php_pdo_mysql.dll<br>
extension=php_pdo_sqlite.dll<br>
extension=php_imap.dll<br>
extension=php_tidy.dll<br>
Nader
  • 1,120
  • 1
  • 9
  • 22