2013-02-25 97 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'中。它解決了你的問題。