致命错误:未捕获的异常'ReflectionException'

时间:2015-04-15 00:44:48

标签: php laravel composer-php

运行php代码时出现了类似的错误(Uncaught exception 'ReflectionException')。但是我没有运气来修复它。

Uncaught exception 'ReflectionException' with message 'Class path.base does not exist' in /home/localblu/staging/vendor/laravel/framework/src/Illuminate/Container/Container.php:504 Stack trace: 

#0 /home/localblu/staging/vendor/laravel/framework/src/Illuminate/Container/Container.php(504): ReflectionClass->__construct('path.base') 

#1 /home/localblu/staging/vendor/laravel/framework/src/Illuminate/Container/Container.php(428): Illuminate\Container\Container->build('path.base', Array) 

#2 /home/localblu/staging/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(462): Illuminate\Container\Container->make('path.base', Array)

#3 /home/localblu/staging/vendor/laravel/framework/src/Illuminate/Container/Container.php(806): Illuminate\Foundation\Application->make('path.base')

#4 /home/localblu/staging/bootstrap/start.php(11): Illuminate\Container\Container->offsetGet('path.base') 

#5 /home/localblu/staging/public/index.php(35): require_once('/home/localblu/...') 

#6 {main} thrown in /home/localblu/staging/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 504

这是我的composer.json文件:

{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
    "laravel/framework": "4.2.*",
            "phpunit/phpunit": "3.7.*",
    "davejamesmiller/laravel-breadcrumbs": "~2.3"
},
"autoload": {
    "classmap": [
        "app/commands",
        "app/controllers",
        "app/models",
        "app/database/migrations",
        "app/database/seeds",
        "app/tests/TestCase.php"
    ]
},
"scripts": {
    "post-install-cmd": [
        "php artisan clear-compiled",
        "php artisan optimize"
    ],
    "post-update-cmd": [
        "php artisan clear-compiled",
        "php artisan optimize"
    ],
    "post-create-project-cmd": [
        "php artisan key:generate"
    ]
},
"config": {
    "preferred-install": "dist"
},
"minimum-stability": "stable"

}

你们可以帮帮我吗?

2 个答案:

答案 0 :(得分:0)

运行

 composer dump-autoload

如评论或

中所述
 composer dump-autoload -o

这解决了我的问题

答案 1 :(得分:0)

在Laravel项目文件夹中转到app/Exceptions/Handler.php 并请评论app('sneaker')->captureException($exception);行 然后,您将得到确切的错误,然后解决错误