1

完成composer update我的项目后,我的生产环境中的任何地方都开始显示此错误。但是在本地运行良好。

Fatal error: Uncaught exception 'ReflectionException' with message 'Class log does not exist' in 
.../src/Illuminate/Container/Container.php:736 Stack trace: #0 
.../src/Illuminate/Container/Container.php(736): ReflectionClass->__construct('log') #1 
.../src/Illuminate/Container/Container.php(626): Illuminate\Container\Container->build('log', Array) #2 
.../src/Illuminate/Foundation/Application.php(674): Illuminate\Container\Container->make('log', Array) #3 
.../src/Illuminate/Container/Container.php(837): Illuminate\Foundation\Application->make('Psr\\Log\\LoggerI...') #4 
.../src/Illuminate/Container/Container.php(800): Illuminate\Container\Container->resolveClass(Object(ReflectionParameter)) #5 
.../src/Illuminate/Container/Container.php(771): Illuminate\Cont in 
.../src/Illuminate/Container/Container.php on line 736

我的本地环境是 OSX 10.10.5,我的生产环境是 Linux。我又做了composer update一次,但没有修复错误。

我的 composer.json 是这样的:

...
"require": {
    "php": ">=5.5.9",
    "laravel/framework": "5.1.*",
    "folklore/image": "0.2.*",
    "illuminate/html": "5.*",
    "cartalyst/sentry": "dev-feature/laravel-5"
},
"require-dev": {
    "fzaninotto/faker": "~1.4",
    "mockery/mockery": "0.9.*",
    "phpunit/phpunit": "~4.0",
    "phpspec/phpspec": "~2.1",
    "laracasts/generators": "~1.1",
    "php-console/php-console": "~3.0",
    "php-console/laravel-service-provider": "~5.0"
}, 
...
4

2 回答 2

2

多谢你们!

我发现了问题。

删除了我的 composer.json 和作品的包。

"php-console/php-console": "~3.0",

“php-console/laravel-service-provider”:“~5.0”

我认为服务器不支持这些软件包,因为.bat软件包工作需要一个文件。

于 2015-09-04T13:22:59.003 回答
-1

大多数情况下,此错误修复非常简单。赶紧跑

composer dump-autoload

毫无疑问,您的错误将得到修复。

于 2015-09-03T13:19:26.883 回答