i have a laravel project i have to work on. The project runs on laravel 8, PHP version 7.x. I use XAMPP as a server, my laptop is working with windows 11 and i work with PHPstorm with the local terminal. When i want to use composer update, or composer install i get the following error:

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

  Problem 1
    - league/flysystem[1.1.0, ..., 1.1.10] require ext-fileinfo * -> it is missing from your system. Install or enable PHP's fileinfo extension.
    - Root composer.json requires dyrynda/laravel-cascade-soft-deletes ^4.1 -> satisfiable by dyrynda/laravel-cascade-soft-deletes[4.1.0, ..., 4.3.0].
    - laravel/framework[v8.11.0, ..., v8.83.27] require league/flysystem ^1.1 -> satisfiable by league/flysystem[1.1.0, ..., 1.1.10].
    - Root composer.json requires klips/dingoquerymapper 5.7 -> satisfiable by klips/dingoquerymapper[5.7].
    - klips/dingoquerymapper 5.7 requires laravel/framework >=5.7 -> satisfiable by laravel/framework[v8.0.0, ..., v8.83.27].
    - Only one of these can be installed: illuminate/events[v8.12.0, ..., v8.83.27, v9.0.0, ..., v9.52.4, v10.0.0, ..., v10.3.3], laravel/framework[v8.0.0, ..., v8.83.27]. laravel/framework replaces illuminate/events and thus cannot coexist with it.
    - Conclusion: install illuminate/events v8.83.27 (conflict analysis result)

To enable extensions, verify that they are enabled in your .ini files:
    - C:\Program Files\php-7.4.33-Win32-vc15-x64\php.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.

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

I already found online the information to uncomment in my php.ini file the line extension=fileinfo. I have in my php folder 2 files: php.ini-development and php.ini-production. The problem is, after opening both files in notepad i can not safe the file. I get the errorenter image description here

Also when i want to use artisan i get the following error:

PHP Fatal error:  Uncaught Error: Class 'Illuminate\Foundation\Application' not found in D:\Uni\BA\eSano\aas2-backend\src\bootstrap\app.php:14
Stack trace:
#0 D:\Uni\BA\eSano\aas2-backend\src\artisan(18): require_once()
#1 {main}
  thrown in D:\Uni\BA\eSano\aas2-backend\src\bootstrap\app.php on line 14

This is my composer.json file:

"name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "type": "project",
    "require": {
        "php": ">= 7.4.0",
        "laravel/framework": "^8.0",
        "symfony/translation": "5.1.7",
        "dingo/api": "^3.0.0",
        "tymon/jwt-auth": "1.0.*",
        "lcobucci/jwt": "3.3.3",
        "fideloper/proxy": "^4.0",


        "tembra/jsonapi-errors-php": "~0.8.0",
        "cmgmyr/messenger": "~2.0",


        "klips/dingoquerymapper": "5.7",


        "php-http/guzzle6-adapter" : "~1.1.0",
        "yzalis/identicon" : "1.2.0",
        
        "doctrine/dbal": "^2.10",
        "marktopper/doctrine-dbal-timestamp-type": "^1.0",
        
        "astrotomic/laravel-translatable": "^11.9",
        "astrotomic/laravel-mime": "^0.3.0",
        "laravel/ui": "^3.0",
        "ricardoboss/laravel-user-settings": "^2.2",
        "dyrynda/laravel-cascade-soft-deletes": "^4.1",
        "fruitcake/laravel-cors": "^2.0",
        "robthree/twofactorauth": "~1.8.2",
        "barryvdh/laravel-snappy": "0.4.8",
        "laravel/legacy-factories": "^1.1"
        
    },
    "require-dev": {
        "fzaninotto/faker": "~1.4",
        "mockery/mockery": "0.9.*",
        "phpunit/phpunit": "^8.5",
        "codeception/codeception": "4.1.0",
        "flow/jsonpath": "*",
        "symfony/dom-crawler": "5.2.*",
        "symfony/css-selector": "3.1.*",
        "filp/whoops":"~2.0",
        "codeception/module-rest": "^1.3",
        "codeception/module-laravel5": "^1.1",
        "codeception/module-asserts": "^1.3",
        "codeception/module-db": "^1.1"
    },
    "autoload": {

        "psr-4": {
            "App\\": "app/",
            "Database\\Factories\\": "database/factories/",
            "Database\\Factories\\Translations\\": "database/factories/translations",
            "Database\\Factories\\Elements\\": "database/factories/elements",
            "Database\\Factories\\Elements\\Translations\\": "database/factories/elements/translations",
            "Database\\Seeders\\": "database/seeders/"
        },
        "files": [
            "app/Api/V1/Misc/helpers.php"
        ]
    },
    "autoload-dev": {
        "classmap": [
            "tests/"
        ]
    },
    "scripts": {
        "post-root-package-install": [
            "php -r \"copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "php artisan key:generate"
        ],
        "post-install-cmd": [
            "Illuminate\\Foundation\\ComposerScripts::postInstall"
        ],
        "post-update-cmd": [
            "Illuminate\\Foundation\\ComposerScripts::postUpdate"
        ],
        "post-autoload-dump": [
            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover"
        ]
    },
    "config": {
        "preferred-install": "dist"
    },

Is there something that i am missing? I already went through all Stackoverflow questions that were similar and i could't solve my problem yet

Every help will be apreciated. Thank you

I already went to the windows settings and put UAT settings on low

I also added inside of my composer.json the following codes of line:

"pre-update-cmd": [
        "@php artisan clear-compiled"
    ],

    "post-install-cmd": [
        "Illuminate\\Foundation\\ComposerScripts::postInstall",
        "php artisan optimize"
    ],
    "post-update-cmd": [
        "Illuminate\\Foundation\\ComposerScripts::postUpdate",
        "php artisan optimize"
    ] 
1

There are 1 answers

1
Eloy Ruiz On

If you are working with XAMPP on Windows just go to http://localhost/dashboard/phpinfo.php and look for the variable Loaded Configuration File which probably will have this value C:\xampp\php\php.ini Check your value and with that you'll know where's the file that needs to be edited. Edit the file, uncomment the needed extensions, reboot your Apache server in XAMPP and check again the phpinfo.php. If the extension was correctly loaded, search for the string "fileinfo" and you should find something like this:

fileinfo
fileinfo support    enabled
libmagic    537

If you followed the standard XAMPP installation, the php.ini file should be in the indicated path and you shouldn't have problems with permissions.