执行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"
},
...
答案 0 :(得分:2)
谢谢你们!
我发现了问题。
我删除了我的composer.json的包并且正常工作。
" php-console / php-console":" ~3.0",
" php-console / laravel-service-provider":" ~5.0"
我认为服务器不支持这些软件包,因为软件包的.bat
文件是必需的。
答案 1 :(得分:-1)
大多数情况下,此错误修复非常简单。跑吧
composer dump-autoload
毫无疑问,您的错误将被修复。