Lumen installation error

人盡茶涼 提交于 2020-01-13 19:46:11

问题


I am trying to install lumen with composer so I used the command below

composer create-project --prefer-dist laravel/lumen api

But, for some reason I am getting this error before even doing anything, just visiting the public folder.

Sorry, the page you are looking for could not be found.

1/1
NotFoundHttpException in RoutesRequests.php line 442:
in RoutesRequests.php line 442
at Application->handleDispatcherResponse(array('0')) in RoutesRequests.php line 381
at Application->Laravel\Lumen\Concerns{closure}() in RoutesRequests.php line 624
at Application->sendThroughPipeline(array(), object(Closure)) in RoutesRequests.php line 382
at Application->dispatch(null) in RoutesRequests.php line 327
at Application->run() in index.php line 28

回答1:


Assuming you are running lumen from a subdirectory, in public/index.php change:

$app->run();

to

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

That did the trick for me.



来源:https://stackoverflow.com/questions/35974469/lumen-installation-error

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