2

我在本地主机中安装了 laravel+composer,然后尝试使用以下代码块运行基本 routes.php:

 Route::get('/x', function()
{
    return 'Hello World';
});

然后我尝试使用它来运行http://localhost/laravel/app/xhttp://localhost/laravel/x

我得到了这个错误类型:

Object not found!

The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.

If you think this is a server error, please contact the webmaster.

Error 404

localhost
Apache/2.4.4 (Unix) PHP/5.5.3 OpenSSL/1.0.1e mod_perl/2.0.8-dev Perl/v5.16.3

我该如何克服这个问题?

4

1 回答 1

1

所有 Laravel 路由都通过 public 文件夹。

假设您的项目名称是 Laravel,这应该可以工作。

http://localhost/laravel/public/x
于 2013-12-15T05:12:54.703 回答