Kohana 3.2不加载配置文件

时间:2011-10-02 18:07:30

标签: nginx kohana config kohana-3

我正在使用Kohana 3.2开发一个Web应用程序,并加载了以下模块:

  • useradmin
  • AUTH
  • 数据库
  • ORM
  • 分页
  • 的OAuth
  • Kohana的电子邮件

在我的开发机器上(Mac OS X Lion with Apache)一切都很好。

在运行带有nginx 1.1.0的ubuntu 10.04的网络服务器上,未加载配置文件。

当我尝试登录时生效。 Kohana给了我以下错误:

A valid hash key must be set in your auth config.

如果我看一下Kohana :: $ config,它就是空的。这给我的结论是我的配置没有加载。

有没有人知道会导致这种行为的原因。

我的目录看起来像这样

application/
├── bootstrap.php
├── cache
├── classes
│   ├── controller
│   │   ├── …
│   └── model
├── config
│   ├── auth.php
│   ├── database.php
│   └── pagination.php
├── i18n
│   └── …
├── logs
│   └── …
├── messages
└── views
    └── template
        └── default.php

编辑:因为我认为错误必须在我的服务器环境中,这是我的nginx配置。

服务器{         听80;

    root /srv/www/;
    index index.php;

    location / {
            try_files $uri /index.php?$query_string;
    }

    location /index.php {
            fastcgi_param KOHANA_ENV development;
            fastcgi_pass unix:/var/run/php-fastcgi/php-fastcgi.socket;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME $document_root/index.php;
            include /etc/nginx/fastcgi_params;
    }

}

1 个答案:

答案 0 :(得分:2)

语法在3.2

中有所改变

Kohana::$config将保持为空,直到您实际将配置文件加载到其中,并使用:

Kohana::$config->load('auth')

migration from 3.1.x section

中的用户指南已对此进行了解决