【发布时间】:2016-09-21 22:26:09
【问题描述】:
环境详情:
- Windows 10
- PHP7
- Apache 2.4。
我采取的行动
我使用以下方法将 Lumen 安装到 htdocs 文件夹中:
composer create-project --prefer-dist laravel/lumen blog
所以现在 index.php 的文件路径是:
c:\Apache24\htdocs\blog\public\
这是我的 routes.php 的内容:
$app->get('/', function () use ($app) {
return $app->version();
});
$app->get( 'foo', function() {
return "Hello World!";
} );
首先我什至无法访问http://localhost/blog/public,所以我将public/index.php代码中的$app->run();行更改为$app->run($app->make('request'));
问题:
现在我无法访问http://localhost/blog/public/foo(响应为 404)
编辑
根据 Alexei 的建议,我更改了配置文件,现在 http://localhost 指向 '/' 路由,但我仍然无法访问 http://localhost/foo
感谢帮助;)
【问题讨论】: