2

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
patricus
  • 59,488
  • 15
  • 143
  • 145

1 Answers1

3

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.

  • Any ideas as to why this happens? Is it how it is supposed to be? –  Mar 14 '16 at 12:40
  • My best guess is that Lumen, being a super lightweight framework, makes some assumptions to save every ounce of computation time. One of those assumptions must be that you are running the application at the root domain level. That is just a guess though, someone with more knowledge of the framework could probably give you a more definite answer on that. – moraleslevi Mar 15 '16 at 01:26