哎呀,看起来像出事了。尝试在内置服务器上运行时 Laravel 5 中的错误

Posted

技术标签:

【中文标题】哎呀,看起来像出事了。尝试在内置服务器上运行时 Laravel 5 中的错误【英文标题】:Whoops, looks like something went wrong. error in Laravel 5 when trying to run on built in server 【发布时间】:2016-02-20 01:55:25 【问题描述】:

我从我的 git repo 中克隆了一个项目并尝试执行以下命令

php artisan serve 

我得到了

Laravel 5 Failed opening required bootstrap/../vendor/autoload.php

所以我跟着这个答案

Laravel 5 Failed opening required bootstrap/../vendor/autoload.php

然后做了composer install

在我这样做之后

php artisan serve 

服务器启动正常,但在 chrome 浏览器中出现以下错误

Whoops, looks like something went wrong. error in Laravel 5 

任何可能出现问题的提示

更新

我打开文件夹 storage/logs/ 有一个文件叫laravel 这是它的转储

`[2015-11-18 10:48:25] production.ERROR: exception 'RuntimeException' with message 'No supported encrypter found. The cipher and / or key length are invalid.' in D:\iclock.in\bootstrap\cache\compiled.php:6943
Stack trace:
#0 D:\iclock.in\bootstrap\cache\compiled.php(1242): Illuminate\Encryption\EncryptionServiceProvider->Illuminate\Encryption\closure(Object(Illuminate\Foundation\Application), Array)
#1 D:\iclock.in\bootstrap\cache\compiled.php(1195): Illuminate\Container\Container->build(Object(Closure), Array)
#2 D:\iclock.in\bootstrap\cache\compiled.php(1733): Illuminate\Container\Container->make('encrypter', Array)
#3 D:\iclock.in\bootstrap\cache\compiled.php(1287): Illuminate\Foundation\Application->make('Illuminate\\Cont...')
#4 D:\iclock.in\bootstrap\cache\compiled.php(1271): Illuminate\Container\Container->resolveClass(Object(ReflectionParameter))
#5 D:\iclock.in\bootstrap\cache\compiled.php(1257): Illuminate\Container\Container->getDependencies(Array, Array)
#6 D:\iclock.in\bootstrap\cache\compiled.php(1195): Illuminate\Container\Container->build('App\\Http\\Middle...', Array)
#7 D:\iclock.in\bootstrap\cache\compiled.php(1733): Illuminate\Container\Container->make('App\\Http\\Middle...', Array)
#8 D:\iclock.in\bootstrap\cache\compiled.php(9459): Illuminate\Foundation\Application->make('App\\Http\\Middle...')
#9 D:\iclock.in\bootstrap\cache\compiled.php(2932): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\closure(Object(Illuminate\Http\Request))
#10 [internal function]: Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle(Object(Illuminate\Http\Request), Object(Closure))
#11 D:\iclock.in\bootstrap\cache\compiled.php(9459): call_user_func_array(Array, Array)
#12 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\closure(Object(Illuminate\Http\Request))
#13 D:\iclock.in\bootstrap\cache\compiled.php(9449): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#14 D:\iclock.in\bootstrap\cache\compiled.php(2209): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#15 D:\iclock.in\bootstrap\cache\compiled.php(2192): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
#16 D:\iclock.in\public\index.php(54): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#17 D:\iclock.in\server.php(21): require_once('D:\\iclock.in\\pu...')
#18 main  
[2015-11-18 10:48:25] production.ERROR: exception 'RuntimeException' with message 'No supported encrypter found. The cipher and / or key length are invalid.' in D:\iclock.in\bootstrap\cache\compiled.php:6943
Stack trace:
#0 D:\iclock.in\bootstrap\cache\compiled.php(1242): Illuminate\Encryption\EncryptionServiceProvider->Illuminate\Encryption\closure(Object(Illuminate\Foundation\Application), Array)
#1 D:\iclock.in\bootstrap\cache\compiled.php(1195): Illuminate\Container\Container->build(Object(Closure), Array)
#2 D:\iclock.in\bootstrap\cache\compiled.php(1733): Illuminate\Container\Container->make('encrypter', Array)
#3 D:\iclock.in\bootstrap\cache\compiled.php(1287): Illuminate\Foundation\Application->make('Illuminate\\Cont...')
#4 D:\iclock.in\bootstrap\cache\compiled.php(1271): Illuminate\Container\Container->resolveClass(Object(ReflectionParameter))
#5 D:\iclock.in\bootstrap\cache\compiled.php(1257): Illuminate\Container\Container->getDependencies(Array, Array)
#6 D:\iclock.in\bootstrap\cache\compiled.php(1195): Illuminate\Container\Container->build('App\\Http\\Middle...', Array)
#7 D:\iclock.in\bootstrap\cache\compiled.php(1733): Illuminate\Container\Container->make('App\\Http\\Middle...', Array)
#8 D:\iclock.in\bootstrap\cache\compiled.php(2216): Illuminate\Foundation\Application->make('App\\Http\\Middle...')
#9 D:\iclock.in\public\index.php(58): Illuminate\Foundation\Http\Kernel->terminate(Object(Illuminate\Http\Request), Object(Illuminate\Http\Response))
#10 D:\iclock.in\server.php(21): require_once('D:\\iclock.in\\pu...')
#11 main  
[2015-11-18 10:48:32] production.ERROR: exception 'RuntimeException' with message 'No supported encrypter found. The cipher and / or key length are invalid.' in D:\iclock.in\bootstrap\cache\compiled.php:6943
Stack trace:
#0 D:\iclock.in\bootstrap\cache\compiled.php(1242): Illuminate\Encryption\EncryptionServiceProvider->Illuminate\Encryption\closure(Object(Illuminate\Foundation\Application), Array)
#1 D:\iclock.in\bootstrap\cache\compiled.php(1195): Illuminate\Container\Container->build(Object(Closure), Array)
#2 D:\iclock.in\bootstrap\cache\compiled.php(1733): Illuminate\Container\Container->make('encrypter', Array)
#3 D:\iclock.in\bootstrap\cache\compiled.php(1287): Illuminate\Foundation\Application->make('Illuminate\\Cont...')
#4 D:\iclock.in\bootstrap\cache\compiled.php(1271): Illuminate\Container\Container->resolveClass(Object(ReflectionParameter))
#5 D:\iclock.in\bootstrap\cache\compiled.php(1257): Illuminate\Container\Container->getDependencies(Array, Array)
#6 D:\iclock.in\bootstrap\cache\compiled.php(1195): Illuminate\Container\Container->build('App\\Http\\Middle...', Array)
#7 D:\iclock.in\bootstrap\cache\compiled.php(1733): Illuminate\Container\Container->make('App\\Http\\Middle...', Array)
#8 D:\iclock.in\bootstrap\cache\compiled.php(9459): Illuminate\Foundation\Application->make('App\\Http\\Middle...')
#9 D:\iclock.in\bootstrap\cache\compiled.php(2932): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\closure(Object(Illuminate\Http\Request))
#10 [internal function]: Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle(Object(Illuminate\Http\Request), Object(Closure))
#11 D:\iclock.in\bootstrap\cache\compiled.php(9459): call_user_func_array(Array, Array)
#12 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\closure(Object(Illuminate\Http\Request))
#13 D:\iclock.in\bootstrap\cache\compiled.php(9449): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#14 D:\iclock.in\bootstrap\cache\compiled.php(2209): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#15 D:\iclock.in\bootstrap\cache\compiled.php(2192): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
#16 D:\iclock.in\public\index.php(54): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#17 D:\iclock.in\server.php(21): require_once('D:\\iclock.in\\pu...')
#18 main  
[2015-11-18 10:48:32] production.ERROR: exception 'RuntimeException' with message 'No supported encrypter found. The cipher and / or key length are invalid.' in D:\iclock.in\bootstrap\cache\compiled.php:6943
Stack trace:
#0 D:\iclock.in\bootstrap\cache\compiled.php(1242): Illuminate\Encryption\EncryptionServiceProvider->Illuminate\Encryption\closure(Object(Illuminate\Foundation\Application), Array)
#1 D:\iclock.in\bootstrap\cache\compiled.php(1195): Illuminate\Container\Container->build(Object(Closure), Array)
#2 D:\iclock.in\bootstrap\cache\compiled.php(1733): Illuminate\Container\Container->make('encrypter', Array)
#3 D:\iclock.in\bootstrap\cache\compiled.php(1287): Illuminate\Foundation\Application->make('Illuminate\\Cont...')
#4 D:\iclock.in\bootstrap\cache\compiled.php(1271): Illuminate\Container\Container->resolveClass(Object(ReflectionParameter))
#5 D:\iclock.in\bootstrap\cache\compiled.php(1257): Illuminate\Container\Container->getDependencies(Array, Array)
#6 D:\iclock.in\bootstrap\cache\compiled.php(1195): Illuminate\Container\Container->build('App\\Http\\Middle...', Array)
#7 D:\iclock.in\bootstrap\cache\compiled.php(1733): Illuminate\Container\Container->make('App\\Http\\Middle...', Array)
#8 D:\iclock.in\bootstrap\cache\compiled.php(2216): Illuminate\Foundation\Application->make('App\\Http\\Middle...')
#9 D:\iclock.in\public\index.php(58): Illuminate\Foundation\Http\Kernel->terminate(Object(Illuminate\Http\Request), Object(Illuminate\Http\Response))
#10 D:\iclock.in\server.php(21): require_once('D:\\iclock.in\\pu...')
#11 main  
[2015-11-18 10:49:10] production.ERROR: exception 'RuntimeException' with message 'No supported encrypter found. The cipher and / or key length are invalid.' in D:\iclock.in\bootstrap\cache\compiled.php:6943
Stack trace:
#0 D:\iclock.in\bootstrap\cache\compiled.php(1242): Illuminate\Encryption\EncryptionServiceProvider->Illuminate\Encryption\closure(Object(Illuminate\Foundation\Application), Array)
#1 D:\iclock.in\bootstrap\cache\compiled.php(1195): Illuminate\Container\Container->build(Object(Closure), Array)
#2 D:\iclock.in\bootstrap\cache\compiled.php(1733): Illuminate\Container\Container->make('encrypter', Array)
#3 D:\iclock.in\bootstrap\cache\compiled.php(1287): Illuminate\Foundation\Application->make('Illuminate\\Cont...')
#4 D:\iclock.in\bootstrap\cache\compiled.php(1271): Illuminate\Container\Container->resolveClass(Object(ReflectionParameter))
#5 D:\iclock.in\bootstrap\cache\compiled.php(1257): Illuminate\Container\Container->getDependencies(Array, Array)
#6 D:\iclock.in\bootstrap\cache\compiled.php(1195): Illuminate\Container\Container->build('App\\Http\\Middle...', Array)
#7 D:\iclock.in\bootstrap\cache\compiled.php(1733): Illuminate\Container\Container->make('App\\Http\\Middle...', Array)
#8 D:\iclock.in\bootstrap\cache\compiled.php(9459): Illuminate\Foundation\Application->make('App\\Http\\Middle...')
#9 D:\iclock.in\bootstrap\cache\compiled.php(2932): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\closure(Object(Illuminate\Http\Request))
#10 [internal function]: Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle(Object(Illuminate\Http\Request), Object(Closure))
#11 D:\iclock.in\bootstrap\cache\compiled.php(9459): call_user_func_array(Array, Array)
#12 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\closure(Object(Illuminate\Http\Request))
#13 D:\iclock.in\bootstrap\cache\compiled.php(9449): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#14 D:\iclock.in\bootstrap\cache\compiled.php(2209): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#15 D:\iclock.in\bootstrap\cache\compiled.php(2192): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
#16 D:\iclock.in\public\index.php(54): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#17 D:\iclock.in\server.php(21): require_once('D:\\iclock.in\\pu...')
#18 main  
[2015-11-18 10:49:10] production.ERROR: exception 'RuntimeException' with message 'No supported encrypter found. The cipher and / or key length are invalid.' in D:\iclock.in\bootstrap\cache\compiled.php:6943
Stack trace:
#0 D:\iclock.in\bootstrap\cache\compiled.php(1242): Illuminate\Encryption\EncryptionServiceProvider->Illuminate\Encryption\closure(Object(Illuminate\Foundation\Application), Array)
#1 D:\iclock.in\bootstrap\cache\compiled.php(1195): Illuminate\Container\Container->build(Object(Closure), Array)
#2 D:\iclock.in\bootstrap\cache\compiled.php(1733): Illuminate\Container\Container->make('encrypter', Array)
#3 D:\iclock.in\bootstrap\cache\compiled.php(1287): Illuminate\Foundation\Application->make('Illuminate\\Cont...')
#4 D:\iclock.in\bootstrap\cache\compiled.php(1271): Illuminate\Container\Container->resolveClass(Object(ReflectionParameter))
#5 D:\iclock.in\bootstrap\cache\compiled.php(1257): Illuminate\Container\Container->getDependencies(Array, Array)
#6 D:\iclock.in\bootstrap\cache\compiled.php(1195): Illuminate\Container\Container->build('App\\Http\\Middle...', Array)
#7 D:\iclock.in\bootstrap\cache\compiled.php(1733): Illuminate\Container\Container->make('App\\Http\\Middle...', Array)
#8 D:\iclock.in\bootstrap\cache\compiled.php(2216): Illuminate\Foundation\Application->make('App\\Http\\Middle...')
#9 D:\iclock.in\public\index.php(58): Illuminate\Foundation\Http\Kernel->terminate(Object(Illuminate\Http\Request), Object(Illuminate\Http\Response))
#10 D:\iclock.in\server.php(21): require_once('D:\\iclock.in\\pu...')
#11 main  

` 感谢和问候

【问题讨论】:

通常错误之后是堆栈跟踪,也许您也可以发布它? 我只是收到此错误,即使我无法理解为什么会发生这种情况, 查看日志,这些应该在storage/logs @Jerodev 好的,我会看到 @Jerodev 我用日志转储更新了我的问题 【参考方案1】:

您的项目根目录中似乎没有.env 文件。此文件包含您的应用程序的所有全局设置。

通常在您的应用程序的根目录中有一个.env.example 文件。将此文件重命名为 .env 并将 APP_KEY 属性更改为随机字符串以提高安全性。

【讨论】:

好吧,我已经解决了。很多事情都必须改变,包括 .env 文件:)。不管怎样,我会接受你的回答【参考方案2】:
    .env.example 重命名为 .env 转到 bootstrap=>app.php 并取消注释 $app->withEloquent(); 确保 APP_DEBUG=true.env 文件中。现在它可以工作了。

【讨论】:

以上是关于哎呀,看起来像出事了。尝试在内置服务器上运行时 Laravel 5 中的错误的主要内容,如果未能解决你的问题,请参考以下文章

哎呀,看起来像出事了。拉拉维尔 5.0

Laravel 5上未显示自定义错误页面

在laravel刀片php的PHP代码

在 CI 集成之前安装 cocoapods

让 objdump 在每个助记符上使用像 l 这样的操作数大小的后缀,即使它不是模棱两可的?

当我从 iPad 切换到 iPhone 在 xcode 上“查看为”时,一个场景仍然看起来像 iPad