我用谷歌搜索了这个问题,有很多人遇到过这个问题,但每个人都有自己非常独特的案例,最后我读到的任何东西都没有帮助我。
我刚刚用 xampp 完成了 Laravel,希望正确。Apache和MySQL正在运行。
我从第一个教程开始:http://laravel.com/docs/4.2/quick#routing
我的应用根目录是:http://localhost/Laravel/tests/app/
hello.php 文件对我有用,我什至测试了一些 php 代码(普通不是 laravel),它起作用了:http://localhost/Laravel/tests/app/views/hello.php
按照教程的指示,我在应用程序/路由中添加了.php:
Route::get('users', function()
{
return 'Users!';
});
但是当我尝试访问时
http://localhost/Laravel/tests/app/views/users
我得到"找不到对象!",而我应该得到文本"用户!
这不是正确的路由,请使用以下命令进行测试: http://localhot/Laravel/tests/public/users