我有一个laravel项目,我必须工作。该项目运行在laravel 8,PHP版本7.x。我使用XAMPP作为服务器,我的笔记本电脑使用windows 11,我使用PHPstorm与本地终端。当我想使用composer update,或composer install时,我得到以下错误:
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.
我已经在网上找到了要在我的php.ini文件中取消注解的信息,行扩展名=fileinfo。我在我的php文件夹中有2个文件:ini-development和php.ini-production。问题是,在记事本中打开这两个文件后,我无法保护文件。我得到错误enter image description here
当我想使用artisan时,我得到以下错误:
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
这是我的composer.json文件:
"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"
},
有什么是我错过了吗?我已经通过了所有的Stackoverflow问题是类似的,我不能解决我的问题还没有
任何帮助都将感激不尽。谢谢
我已经去窗口设置,并把UAT设置低
我还在composer.json中添加了以下代码行:
"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条答案
按热度按时间6tdlim6h1#
如果你在Windows上使用XAMPP,只需到http://localhost/dashboard/phpinfo.php并查找变量 Loaded Configuration File,该变量的值可能为 *C:\xampp\php\php.ini * 检查你的值,这样你就知道需要编辑的文件在哪里。编辑文件,取消注解所需的扩展名,在XAMPP中重新启动Apache服务器并再次检查phpinfo.php。如果扩展名正确加载,搜索字符串“fileinfo”,你应该会找到类似下面的内容:
如果按照标准的XAMPP安装,php.ini文件应该在指定的路径中,并且您不应该有权限问题。