简体   繁体   English

Laravel 5.6:未捕获的反射异常:类 env 不存在

[英]Laravel 5.6: Uncaught ReflectionException: Class env does not exist

When running my Laravel 5.6 application on it's production server, I'm getting an error as follows both in the browser and in the console when trying to run artisan commands:在它的生产服务器上运行我的Laravel 5.6应用程序时,当我尝试运行 artisan 命令时,我在浏览器和控制台中都收到如下错误:

PHP Fatal error:  Uncaught ReflectionException: Class env does not exist in /var/www/html/service.straightlinefernie.com/dev/vendor/laravel/framework/src/Illuminate/Container/Container.php:767
Stack trace:
#0 /var/www/html/service.straightlinefernie.com/dev/vendor/laravel/framework/src/Illuminate/Container/Container.php(767): ReflectionClass->__construct('env')
#1 /var/www/html/service.straightlinefernie.com/dev/vendor/laravel/framework/src/Illuminate/Container/Container.php(646): Illuminate\Container\Container->build('env')
#2 /var/www/html/service.straightlinefernie.com/dev/vendor/laravel/framework/src/Illuminate/Container/Container.php(601): Illuminate\Container\Container->resolve('env', Array)
#3 /var/www/html/service.straightlinefernie.com/dev/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(734): Illuminate\Container\Container->make('env', Array)
#4 /var/www/html/service.straightlinefernie.com/dev/vendor/laravel/framework/src/Illuminate/Container/Container.php(1210): Illuminate\Foundation\Application->m in /var/www/html/service.straightlinefernie.com/dev/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 767

The app runs fine on my development environment.该应用程序在我的开发环境中运行良好。 I've combed my .env and config/ files for errors, and it all appears good.我已经梳理了我的.envconfig/文件中的错误,看起来一切都很好。

I'm guessing there is something missing in my server set up, but the main problem as I see it is that this error message is too generic and doesn't provide the information required to discover what specific file or error is actually making the boot process fail.我猜我的服务器设置中缺少一些东西,但我看到的主要问题是此错误消息过于笼统,并且没有提供发现实际启动的特定文件或错误所需的信息过程失败。

The stack trace is not even saved in the log file, and appears only in the console when I try to run artisan commands.堆栈跟踪甚至没有保存在日志文件中,并且仅在我尝试运行 artisan 命令时出现在console

Does anyone know how to get a more detailed error message that can actually help me solve this error?有谁知道如何获得更详细的错误消息,实际上可以帮助我解决此错误?

Perhaps there is a way to edit the file Illuminate/Container/Container.php so that it gives me more info?也许有一种方法可以编辑文件Illuminate/Container/Container.php以便它为我提供更多信息?

Thanks谢谢

If composer dump-autoload -o and php artisan config:clear doesn't work then check your .env for potential errors like this:如果composer dump-autoload -ophp artisan config:clear不起作用,请检查您的.env是否存在如下潜在错误:

KEY=THE VALUE

Should be应该

KEY="THE VALUE"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 未捕获的 ReflectionException:升级到 Laravel 5.6 后类 env 不存在 - Uncaught ReflectionException: Class env does not exist after upgrade to Laravel 5.6 致命错误:未捕获的 ReflectionException:Class “env”不存在 - Fatal error: Uncaught ReflectionException: Class "env" does not exist Laravel-未捕获的ReflectionException:类日志不存在-配置错误 - Laravel - Uncaught ReflectionException: Class log does not exist - Config error Laravel错误:未捕获的ReflectionException:类App \\ Http \\ Kernel不存在 - Laravel Error : Uncaught ReflectionException: Class App\Http\Kernel does not exist 未捕获的 ReflectionException:类日志不存在 Laravel 5.2 - Uncaught ReflectionException: Class log does not exist Laravel 5.2 Laravel | ReflectionException-类不存在 - Laravel | ReflectionException - Class does not exist ReflectionException (-1) Class App\Http\Middleware\MyMiddleware 项目上传到cpanel后laravel 5.6中不存在 - ReflectionException (-1) Class App\Http\Middleware\MyMiddleware does not exist in laravel 5.6 after uploading the project to cpanel ReflectionException: Class ClassName 不存在 - Laravel - ReflectionException: Class ClassName does not exist - Laravel laravel ReflectionException类国家/地区不存在 - laravel ReflectionException Class Country does not exist ReflectionException (-1) Class VoyagerAuth 不存在 - Laravel - ReflectionException (-1) Class VoyagerAuth does not exist - Laravel
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM