skip to Main Content

First I installed PHP from PHP’s official site ( Windows Download ): PHP 8.1 (8.1.8)

Then I installed composer from the official site and its version is Composer version 2.3.10 2022-07-13.

Then I ran composer global require laravel/installer
So after this running laravel in the terminal gives me: Laravel Installer 4.2.12

Now finally, I try to do: composer create-project laravel/laravel freeCodeGram
and I am getting this:

Creating a "laravel/laravel" project at "./freeCodeGram"
Installing laravel/laravel (v9.2.1)
  - Installing laravel/laravel (v9.2.1): Extracting archive
Created project in C:UsersjohnNewOneDriveOneDriveDesktopfreeCodeGram
> @php -r "file_exists('.env') || copy('.env.example', '.env');"
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - laravel/framework[v9.19.0, ..., 9.x-dev] require league/flysystem ^3.0.16 -> satisfiable by league/flysystem[3.0.16, ..., 3.x-dev].
    - league/flysystem[3.0.16, ..., 3.x-dev] require league/mime-type-detection ^1.0.0 -> satisfiable by league/mime-type-detection[1.0.0, ..., 1.11.0].
    - league/mime-type-detection[1.0.0, ..., 1.3.0] require php ^7.2 -> your php version (8.1.8) does not satisfy that requirement.
    - league/mime-type-detection[1.4.0, ..., 1.11.0] require ext-fileinfo * -> it is missing from your system. Install or enable PHP's fileinfo extension.
    - Root composer.json requires laravel/framework ^9.19 -> satisfiable by laravel/framework[v9.19.0, v9.20.0, 9.x-dev].

To enable extensions, verify that they are enabled in your .ini files:
    - C:Program Filesphp-8.1.8php.ini
You can also run `php --ini` in a terminal to see which files are used by PHP in CLI mode.
Alternatively, you can run Composer with `--ignore-platform-req=ext-fileinfo` to temporarily ignore these required extensions.

Now, How do I fix it?

I looked around and people are saying: ‘We need to uncomment the extension extension = fileinfo in the php.ini file from the source folder’

But there is no php.ini filename in the related directory, there is only:
php -> configuration settings
php.ini-production
php.ini-development

and I opened all 3 of them and there is no match for extension = fileinfo so how do I fix this?

2

Answers


  1. Chosen as BEST ANSWER

    Found the answer, we have to look into the configuration folder for the extension fileinfo


  2. I had the same problem but even after uncommenting extension=fileinfo it kept showing the same error, turns out that I uncommented it from php.ini that was in the config of xampp and not in the main configuration folder found in the C drive. Uncommenting the same line from both files solved the problem.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search