Just installed Lumen framework. hit the link http://localhost/lumen/public/ in my browser and got this following error, anyone got any idea about it? Traced it back to the app.php file in bootstrap folder.
4 Answers
if You want to access lumen project without "php artisan serve"
$app->run();
replace with
$request = Illuminate\Http\Request::capture();
$app->run($request);
from this path yourlumenproject/public/index.php

- 409
- 7
- 14
-
1
-
1
-
1
-
1Had the same issue. Works for me as well. Can you explain in short why do we have to do this? – Gaurav Bhor Sep 22 '16 at 20:50
-
$app->run(); this was return default request of app but for run normally i made a capture request and after this when app will run it will not use default request – Shrikant Bhardwaj Oct 14 '16 at 05:18
Open your terminal in the root folder run the following command php artisan serve
.
Lumen development server started on http://localhost:8000/

- 96
- 1
-
@Ggmon could you please be more specific regarding what the issue is exactly? – zegulas Apr 29 '15 at 13:35
-
There are one way to solve this. See this https://github.com/mlntn/lumen-artisan-serve – user7531 Mar 29 '16 at 23:49
if you want to serve your app in local development you can do this :
php -S localhost:8000 -t public/
and it will serve in localhost in port 8000. hope this help.
Note : I'm using Laravel Framework version Lumen (5.2.4) (Laravel Components 5.2.*)

- 9,854
- 17
- 53
- 75
At the moment Lumen only runs in the domain root.
(I've submitted a PR that fixes this but it has yet to be merged)
You have to create a Virtual Host on your local webserver and point the document root of that to the public directory. After that you can access your app with something like: http://lumen.dev
.
A simple alternative to setting this up manually is Laravel Homestead. It is an official Vagrant box made for Laravel, that allows you to easily get your development environment up and running.

- 147,337
- 26
- 332
- 270