Trying to create new Laravel project this error came up

Viewed 17215

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)
4 Answers

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".

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.

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

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 :)

Related