2013-02-25 96 views
-1

试图安装邮箱yii扩展,按照安装说明,但出现错误。不知道如何解决。这是链接扩展http://www.yiiframework.com/extension/mailbox/邮箱扩展yii错误

这里是错误跟踪:

Alias "mailbox.MailboxModule" is invalid. Make sure it points to an existing PHP file and the file is readable. 

Z:\home\localhost\www\Kare2Match\framework\YiiBase.php(316) 

304   if($isClass && (class_exists($className,false) || interface_exists($className,false))) 
305    return self::$_imports[$alias]=$className; 
306 
307   if(($path=self::getPathOfAlias($alias))!==false) 
308   { 
309    if($isClass) 
310    { 
311     if($forceInclude) 
312     { 
313      if(is_file($path.'.php')) 
314       require($path.'.php'); 
315      else 
316       throw new CException(Yii::t('yii','Alias "{alias}" is invalid. Make sure it points to an existing PHP file and the file is readable.',array('{alias}'=>$alias))); 
317      self::$_imports[$alias]=$className; 
318     } 
319     else 
320      self::$classMap[$className]=$path.'.php'; 
321     return $className; 
322    } 
323    else // a directory 
324    { 
325     if(self::$_includePaths===null) 
326     { 
327      self::$_includePaths=array_unique(explode(PATH_SEPARATOR,get_include_path())); 
328      if(($pos=array_search('.',self::$_includePaths,true))!==false) 

+ Z:\home\localhost\www\Kare2Match\framework\YiiBase.php(196): YiiBase::import("mailbox.MailboxModule", true) 

+ Z:\home\localhost\www\Kare2Match\framework\base\CModule.php(282): YiiBase::createComponent("mailbox.MailboxModule", "mailbox", null, array("userClass" => "PersonAbstract", "userIdColumn" => "k2m_internal_id", "usernameColumn" => "nickname")) 

+ Z:\home\localhost\www\Kare2Match\framework\web\CWebApplication.php(337): CModule->getModule("mailbox") 

+ Z:\home\localhost\www\Kare2Match\framework\web\CWebApplication.php(276): CWebApplication->createController("mailbox") 

+ Z:\home\localhost\www\Kare2Match\framework\web\CWebApplication.php(141): CWebApplication->runController("mailbox") 

需要它帮助。

回答

0

嘿只需添加“类”属性模块“邮箱”在/protected/config/main.php如下:

'modules' => array(

    'mailbox'=> 
    array(
      'class' => 'application.extensions.mailbox.MailboxModule', 
      .............. 
      .............. 
      'userClass' => 'User', 
      'userIdColumn' => 'id', 
      'usernameColumn' => 'username', 

    ); 

如果你觉得这个答案请帮助其他人轻松获得。

0

这是一个难以解决的问题,因为解决方案实际上就是在您的输出中提供的:“确保它指向现有的PHP文件并且该文件可读。”

因此,首先要检查它位于别名“mailbox.MailboxModule”的位置以及它指向哪里?它是否是一个现有的PHP文件?如果是,那么文件的权限允许Web服务器读取它?

要查找别名,请尝试通过您的代码进行文本搜索。要查找文件的权限,请进入终端并执行ls /path/to/theFile.php(在Mac或Linux上... Windows,我不知道)如果您正在使用FTP,您可以通过右键单击某个文件并获取上下文菜单以找出有关文件权限的更多信息。

要了解文件权限read this.

+0

我按照指示,只有4个步骤:解压到模块目录。 安装data/structure.sql – Serghei 2013-02-25 20:49:07

+0

别名'mailbox.MailModule'指向何处? – Stuart 2013-02-25 20:55:52

0

这里是另一种解决方案:

我想,你已经把“邮箱”扩展在/保护/扩展/。请将'邮箱'扩展名放置在'/ protected/modules'中。它解决了你的问题。