laravel 5 致命错误:未捕获的异常“ReflectionException”,消息“类日志不存在”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/29738056/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 11:23:41  来源:igfitidea点击:

laravel 5 Fatal error: Uncaught exception 'ReflectionException' with message 'Class log does not exist'

laravel

提问by hiro

I am using the laravel 5. But will result in an error message when you try to access the site. Solution but I do not know how. Do not know anyone solutions?

我正在使用laravel 5。但是当您尝试访问该站点时会导致错误消息。解决方案,但我不知道如何。不知道有没有人解决?

Fatal error: Uncaught exception 'ReflectionException' with message 'Class log does not exist' in /home/my-project/www/my-project/vendor/compiled.php:1029 Stack trace: #0
/home/my-project/www/my-project/vendor/compiled.php(1029): ReflectionClass->__construct('log') #1 
/home/my-project/www/my-project/vendor/compiled.php(980): Illuminate\Container\Container->build('log', Array) #2 
/home/my-project/www/my-project/vendor/compiled.php(1493): Illuminate\Container\Container->make('log', Array) #3 
/home/my-project/www/my-project/vendor/compiled.php(1072): Illuminate\Foundation\Application->make('Psr\Log\LoggerI...') #4 
/home/my-project/www/my-project/vendor/compiled.php(1056): Illuminate\Container\Container->resolveClass(Object(ReflectionParameter)) #5 
/home/my-project/www/my-project/vendor/compiled.php(1042): Illuminate\Container\Container->getDependencies(Array, Array) #6 
/home/my-project/www/my-project/vendor/compiled.php(980): Illuminate\Container\Container->bui in /home/my-project/www/my-project/vendor/compiled.php on line 1029

回答by PapaHotelPapa

I also had this problem after I made changes to my .envfile that didn't involve any whitespace. After I rolled back my changes I was fine.

.env对不涉及任何空格的文件进行更改后,我也遇到了这个问题。在我回滚我的更改后,我很好。

回答by mylxsw

I have solved this problem by adding Double quotation "for utf8 characters in .envfile.

我通过".env文件中为 utf8 字符添加双引号解决了这个问题。

回答by Kornkrit Leelhaphunt

At first try run

首先尝试运行

composer update

回答by Briganti

I've met with the same problem and after some time wasted I figured out that my deploy script ignored the /config directory and didn't copied to the public site.

我遇到了同样的问题,在浪费了一段时间后,我发现我的部署脚本忽略了 /config 目录并且没有复制到公共站点。

I've copied the /config directory and everything is fine :)

我已经复制了 /config 目录,一切都很好:)

(sry for my english :">)

(对不起我的英语:>)

回答by Jonny Vu

May be edit you composer.json and remove the following packages:

可能会编辑您的 composer.json 并删除以下包:

"php-console/php-console": "~3.0",
"php-console/laravel-service-provider": "~5.0"

run composer updateagain.

composer update再次运行。

回答by Hugo Wijdeveld

I had the same problem. Turned out that I missed single quotes in my .env file. Whenever you specify a constant with a whitespace (in my case 'Webmaster Test') you need to use qoutes around that. Nasty little error!!

我有同样的问题。原来我错过了我的 .env 文件中的单引号。每当您指定一个带有空格的常量(在我的情况下为“网站管理员测试”)时,您都需要在它周围使用 qoutes。讨厌的小错误!!

回答by davidgagnedesign

I had the same problem.

我有同样的问题。

Make sure the php PDO extension is installed correctly.

确保正确安装了 php PDO 扩展。

That worked for me.

那对我有用。