【问题标题】:yii-user-management install 404 erroryii-user-management 安装 404 错误
【发布时间】:2012-09-05 14:39:30
【问题描述】:

我正在使用带有 yii-1.1.12 的 MAMP pro。我正在尝试安装最新版本的 yii-user-management。

我的 webapp 路线是 /Users/myname/Sites/yii-1.1.12/htdocs

我创建了“模块”文件夹并将 yii-user-management 复制到其中:

htdocs > 受保护的 > 模块 (模块和子文件夹设置为重写)

配置/main.php

'modules'=>array(


    'gii'=>array(
        'class'=>'system.gii.GiiModule',
        'password'=>'password',
        // If removed, Gii defaults to localhost only. Edit carefully to taste.
        'ipFilters'=>array('127.0.0.1','::1'),
    ),

            'modules' => array(
                'user' => array(
                        'debug' => true,
                 )
      ),

),

'components'=>array(
    'user'=>array(
        // enable cookie-based authentication
        'class' => 'application.modules.user.components.YumWebUser',
                    'allowAutoLogin'=>true,
                    'loginUrl' => array('//user/user/login'),
    ),
   'import'=>array(
             'application.modules.user.models.*',
           ),
etc...

我已按照信中的说明进行操作,但是当我在浏览器中调用用户/安装时,我收到 404 错误。 http://yii.dev:8888/index.php/user/install

我的页面可以正常工作http://yii.dev:8888/index.php/login(有或没有 index.php)

非常令人沮丧。任何帮助将不胜感激。

【问题讨论】:

  • 只是好奇,这些是您使用的说明吗? yiiframework.com/wiki/68/…
  • 是的,没错,虽然我从 3 号开始。因为我已经安装了 webapp。
  • 我从来没有在 Yii 中使用过这个模块,但是第 6 步不是说要在 URL 中包含数据库的名称吗? http://localhost/testdrive/index.php/user/install,在这种情况下是试驾?
  • 我相信这只是 webapp 文件夹。如 1 和 2 所示。
  • 你是对的,好吧,当你浏览 /modules/ 文件夹时,它是什么样子的?它应该只是一个包含 /user/ 的文件夹,对吗?用户里面的文件夹是什么?

标签: yii


【解决方案1】:

我刚刚意识到你的 config/main.php 有问题...

您在模块中列出了模块:

'modules'=>array(
  'gii'=>array(//...gii configuration...),
  'modules' => array(
    'user' => array(
    'debug' => true,
  )
),

应该是:

'modules'=>array(
  'gii'=>array(//...gii configuration...),
  'user' => array(
    'debug' => true,
  )
),

【讨论】:

  • 非常感谢您救命!
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-03-14
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多