19

I just installed Lumen but when I head to its public directory localhost/lumen/public,

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

will appear.

I checked app\Http\routes.php and changed

$app->get('/', function () use ($app) {

to

$app->get('/lumen/public/', function () use ($app) {

And it worked.

But this is not the thing I want. In Laravel the '/' works perfectly. How can I make Lumen work with '/'?


BTW when I use php artisan serv, '/' works but only in artisan serv :(

4

2 回答 2

37

单程:

/public/index.php变化中

$app->run();

$app->run($app['request']);

另一种方式:

这也有效(更快):

$app->run($app->make('request'));
于 2015-08-09T06:36:48.507 回答
0

当您不使用 php artisan serve 时,您在使用什么?如果您使用的是香草php -S,您还需要像这样指定公共目录:

php -S localhost:8000 -t public/

您需要在lumen目录中执行此操作。

于 2015-06-18T09:17:12.423 回答