NotFoundHttpException with Lumen

半世苍凉 提交于 2019-11-26 10:18:00

问题


I\'ve just installed Lumen on Windows and unfortunately I\'m getting the following error:

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?


回答1:


On your index.php file. Change this line

$app->run();

Into:

$app->run($app->request);

Update

Using make method is faster than accessing class alias via array access.

This one also works:

$app->run(
    $app->make('request')
);



回答2:


The problem was solved by changing the

$app->run();

in /public/index.php to

$request = Illuminate\Http\Request::capture();
$app->run($request);


来源:https://stackoverflow.com/questions/29728973/notfoundhttpexception-with-lumen

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!