Class' Illuminate \ Foundation \ Application'在laravel中找不到

时间:2016-03-29 00:31:18

标签: laravel

我真的不明白我的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并复制所有逻辑,模型,路线和视图。 但错误仍在发生。

我确实将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

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

ps:

这是我的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"
    }
}

2 个答案:

答案 0 :(得分:0)

你的作曲家需要阻止给你带来麻烦

因为你使用了laravel 5.2, 你应该使用

"laravelcollective/html":"^5.2" 并删除"illuminate/html": "^5.0" taylor不再维护此软件包并删除"illuminate/routing": "5.1.1" laravel / framwork已经兼容照明/路由所需的pacakge

答案 1 :(得分:0)

安装Laravel框架似乎需要扩展名mbstring,并且可能已禁用或不存在于您的系统中。

在Windows上

打开php.ini文件,然后取消注释mbstring扩展名的行(从开头删除;)然后运行命令(从项目根文件夹):

composer update

在Ubuntu上

执行以下命令安装扩展程序:

sudo apt-get install php-mbstring