gpt4 book ai didi

laravel - 在 Laravel 中找不到类 'Illuminate\Foundation\Application'

转载 作者:行者123 更新时间:2023-12-03 18:30:18 25 4
gpt4 key购买 nike

我真的不明白我的 Laravel 应用程序发生了什么。我从来没有碰过它 7-14 天,因为我需要专注于我的项目(用 CI 编写)。当我的项目完成后,我回到我的 Laravel 应用程序来探索更多关于它的信息。接下来发生的事情超出了我的想象。我的浏览器出现了这个错误:

Fatal error: Uncaught Error: Class 'Illuminate\Foundation\Application' not found in C:\xampp\htdocs\leadershipradar\bootstrap\app.php:14 Stack trace: #0 C:\xampp\htdocs\leadershipradar\public\index.php(23): require_once() #1 {main} thrown in C:\xampp\htdocs\leadershipradar\bootstrap\app.php on line 14

我搜索如何修复它。我在 stackoverflow 上发现了这个:

http://stackoverflow.com/questions/34172644/getting-error-class-illuminate-foundation-application-not-found-in-laravel-5#

http://stackoverflow.com/questions/34172644/getting-error-class-illuminate-foundation-application-not-found-in-laravel-5

我遵循了所有指示,但一无所获。我还安装了新的 laravel 并复制了所有逻辑、模型、路由和 View 。但错误仍在发生。

我确实将 composer.json 文件更改为:

"require": {
"php": ">=5.5.9",
"laravelcollective/html": "5.1",
"illuminate/routing": "5.1.1",
"laravel/framework": "5.2.10",
"illuminate/html": "^5.0"
},

当我运行 composer update 时,我的 cmd 中出现了新的错误。 enter image description here

请帮我解决这个问题。非常感谢。

附言:

这是我的 composer.json

{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.5.9",
"laravelcollective/html":"^5.2",
"laravel/framework": "5.2.10"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~4.0",
"symfony/css-selector": "2.8.*|3.0.*",
"symfony/dom-crawler": "2.8.*|3.0.*"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
]
},
"scripts": {
"post-root-package-install": [
"php -r \"copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"php artisan key:generate"
],
"post-install-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"post-update-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
]
},
"config": {
"preferred-install": "dist"
}
}

最佳答案

你的 composer require block 给你带来了麻烦

自从你使用 laravel 5.2,你应该使用

"laravelcollective/html":"^5.2"并删除 "illuminate/html": "^5.0" taylor 不再维护此包
并删除 "illuminate/routing": "5.1.1" laravel/framwork 已经需要兼容的 illuminate/routing pacakge

关于laravel - 在 Laravel 中找不到类 'Illuminate\Foundation\Application',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36273463/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com