Sadeen Alaa
Sadeen Alaa

Reputation: 767

Trying to create new Laravel project this error came up

This is my first laravel project and this error appears I can't figure out the solution and I searched for a solution in stack over flow and tried the solutions I found but it doesn't work. composer create-project laravel/laravel newProject4

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

Problem 1 - laravel/framework[v8.54.0, ..., 8.x-dev] require league/flysystem ^1.1 -> satisfiable by league/flysystem[1.1.0, ..., 1.x-dev]. - league/flysystem[1.1.0, ..., 1.x-dev] require ext-fileinfo * -> it is missing from your system. Install or enable PHP's fileinfo extension. - Root composer.json requires laravel/framework ^8.54 -> satisfiable by laravel/framework[v8.54.0, ..., 8.x-dev].

To enable extensions, verify that they are enabled in your .ini files: - C:\php\php.ini You can also run php --ini inside terminal to see which files are used by PHP in CLI mode.

Edit When I wrote php --ini in the command this is what I got

Configuration File (php.ini) Path:
Loaded Configuration File:         C:\php\php.ini
Scan for additional .ini files in: (none)
Additional .ini files parsed:      (none)

Upvotes: 16

Views: 54649

Answers (5)

powtek mostek
powtek mostek

Reputation: 1

In my case the solution was that I added the php environment variable from xammp 'C:\xampp\php', instead of 'C:\Users\ana\Downloads\Compressed\php' and remove the semicolon befor the 'extension=fileinfo' from 'C:\xampp\php.ini' file

Upvotes: -1

ryandi pratama purba
ryandi pratama purba

Reputation: 434

You need to uncomment the extension extension = fileinfo in the php.ini file from the source folder. Then delete projectx dir. Finally, re-run laravel new projectx as per your screenshot.

If you have already uncomment extension = fileinfo in php.ini and it doesn't work. You might need to grant administrator permissions to be able to execute the changes:

To grant these permissions you have to do the following: Note: This for windows 10.

  1. It is located in the file to grant the permission c:/xampp/php/php.ini. And for your case its - C:\MAMP\bin\php\php7.4.1\php.ini

  2. Right click on the file and click on properties.

  3. Security.

  4. Click on the Edit button.

  5. Click on each of the group or user names and at the bottom where it says Permissions for authenticated users, and then check full control.

In this way permission is granted and now if the changes to the file are saved.

Upvotes: 29

Indrakumara
Indrakumara

Reputation: 1645

uncomment the extension "extension = fileinfo" in the php.ini

;extension=bz2
extension=curl
;extension=ffi
;extension=ftp
extension=fileinfo
;extension=gd
;extension=gettext
;extension=gmp
;extension=intl
;extension=imap
;extension=ldap
extension=mbstring

Upvotes: 5

i found the problem and it seems very simple. the error I received was because extension=fileinfo is not active, if it is php.delete the semicolon ';' in the ';extension=fileinfo' line in the ini file and restart the server. i hope this will be the solution :)

Upvotes: -1

Sadeen Alaa
Sadeen Alaa

Reputation: 767

I found the answer, the problem was that I was removing ; before extension = fileinfo from php.ini inside PHP folder in xampp folder "c:/xampp/php/" but I didn't remove it from "c:/php/php.ini".

Upvotes: 47

Related Questions