【发布时间】:2014-08-14 17:41:17
【问题描述】:
这很可能完全是菜鸟,我错过了一些简单的东西,但它整天让我发疯,而且 IRC 也不是很有帮助:c
使用 Laravel PHP 框架和路由失败。
环境:
- 主机 Ubuntu 14.04
- Guest Machine Laravel - Homestead Vanilla(Standard) Vagrant Box
项目:
默认未编辑的 Composer Laravel 项目
行为
导航到 /public 你会得到 laravel 项目的 hello 页面(建议友好的 url 和路由工作正常)。当您导航到 /account 时,您会看到“未指定输入文件。”
守则
-- app/routes.php --
Route::get('/', function()
{
return View::make('hello');
});
Route::get('/account', function()
{
return View::make('account');
});
请注意,Account.PHP 是在视图文件夹中创建的
Nginx 错误日志
2014/06/24 06:56:49 [error] 1307#0: *97 FastCGI sent in stderr: "Unable to open primary script: /home/vagrant/Code/profile_system/index.php (No such file or directory)" while reading response header from upstream, client: 192.168.10.1, server: profile-system.app, request: "GET /accounts/create HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "profile-system.app"
所以显然问题是它无法在项目的 / 中找到 index.php。但是 laravel 在 / 中没有 index.php。
有什么想法吗?有关完整的环境信息,请参阅此链接。很高兴根据要求添加任何其他内容。 https://gist.github.com/Jonjoe/6359e71e47b7a489109c
【问题讨论】: