laravel 流明的 NotFoundHttpException
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/29728973/
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
NotFoundHttpException with Lumen
提问by Timo Güntner
I've just installed Lumenon Windows and unfortunately I'm getting the following error:
我刚刚在 Windows 上安装了Lumen,不幸的是我收到以下错误:
NotFoundHttpException in Application.php line 1093:
in Application.php line 1093
at Application->handleDispatcherResponse(array('0')) in Application.php line 1063
at Application->dispatch(null) in Application.php line 1006
at Application->run() in index.php line 28
What may be the problem here?
这里可能有什么问题?
回答by Timo Güntner
The problem was solved by changing the
问题是通过更改解决的
$app->run();
in /public/index.php to
在 /public/index.php 到
$request = Illuminate\Http\Request::capture();
$app->run($request);
回答by krisanalfa
On your index.php
file. Change this line
在你的index.php
档案上。改变这一行
$app->run();
Into:
进入:
$app->run($app->request);
Update
更新
Using make
method is faster than accessing class alias via array access.
使用make
方法比通过数组访问访问类别名更快。
This one also works:
这个也有效:
$app->run(
$app->make('request')
);