【发布时间】:2015-02-20 04:08:44
【问题描述】:
我刚刚开始学习 Laravel 和 Composer,并且一直在关注我在 Code Bright 中找到的基本路由示例。我已经克隆了 Laravel 存储库,并使用前面 Code Bright 安装部分中提到的 Composer 安装它,并且正在使用建议的 Apache 配置,这与我通常在使用 XAMPP 的其他应用程序中使用的配置非常相似,但是当我输入 url 以查看路由输出时,我得到“哎呀,好像出了点问题”。
第一步
git clone https://github.com/laravel/laravel.git laravel
第 2 步
composer install
第 3 步
<VirtualHost *:80>
# Host that will serve this project.
ServerName laravel.dev
ServerAlias laravel.dev
# The location of our projects public directory.
DocumentRoot "D:/htdocs/laravel/public"
# Useful logs for debug.
ErrorLog "logs/laravel.dev-error.log"
CustomLog "logs/laravel-access.log" common
# Rewrites for pretty URLs, better not to rely on .htaccess.
<Directory "D:/htdocs/laravel/public">
<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
</Directory>
</VirtualHost>
第四步
Route::get( 'my/page', function() {
return 'Hello World!';
});
第 5 步
http://laravel.dev/my/page
我在 Windows 上运行,PHP 版本 5.5.11 通过 XAMPP,最新的 Composer 是通过 Windows 安装程序安装的,等等 PATH,Laravel 是全局安装的。
【问题讨论】:
-
当 laravel 有默认路由时,它工作了吗?
-
嗨@clonerworks,不,你好视图也没有加载,同样的消息。