流明安装错误
Lumen installation error
我正在尝试使用 composer 安装 lumen,所以我使用了下面的命令
composer create-project --prefer-dist laravel/lumen api
但是,出于某种原因,我什至在访问 public 文件夹之前就遇到了这个错误。
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
假设您是来自子目录的 运行 流明,在 public/index.php 中更改:
$app->run();
至
$request = Illuminate\Http\Request::capture();
$app->run($request);
这对我有用。
我正在尝试使用 composer 安装 lumen,所以我使用了下面的命令
composer create-project --prefer-dist laravel/lumen api
但是,出于某种原因,我什至在访问 public 文件夹之前就遇到了这个错误。
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
假设您是来自子目录的 运行 流明,在 public/index.php 中更改:
$app->run();
至
$request = Illuminate\Http\Request::capture();
$app->run($request);
这对我有用。