【问题标题】:Clean Install of Laravel using Code Bright Basic Routing Example Not Routing使用 Code Bright Basic Routing Example Not Routing 干净安装 Laravel
【发布时间】: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,不,你好视图也没有加载,同样的消息。

标签: php apache laravel-4


【解决方案1】:

知道了!我不得不在 app/config/app.php 中打开调试,这会在一个令人惊讶的描述性调试屏幕中弹出问题,然后运行 ​​key generate,因为错误是缺少加密密钥

php artisan key:generate

【讨论】:

    猜你喜欢
    • 2022-12-02
    • 1970-01-01
    • 2011-03-22
    • 1970-01-01
    • 2015-09-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-03-11
    相关资源
    最近更新 更多