2016-07-25 150 views
1

敏感的我从警予一些脚本配置后,它会抛出这样的错误:案例Yii框架

Alias "application.components.HFooter" is invalid. Make sure it points to an existing PHP file and the file is readable. 

/var/www/rumah/framework/YiiBase.php(322) 

310   if($isClass && (class_exists($className,false) || interface_exists($className,false))) 
311    return self::$_imports[$alias]=$className; 
312 
313   if(($path=self::getPathOfAlias($alias))!==false) 
314   { 
315    if($isClass) 
316    { 
317     if($forceInclude) 
318     { 
319      if(is_file($path.'.php')) 
320       require($path.'.php'); 
321      else 
322       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))); 
323      self::$_imports[$alias]=$className; 
324     } 
325     else 
326      self::$classMap[$className]=$path.'.php'; 
327     return $className; 
328    } 
329    else // a directory 
330    { 
331     if(self::$_includePaths===null) 
332     { 
333      self::$_includePaths=array_unique(explode(PATH_SEPARATOR,get_include_path())); 
334      if(($pos=array_search('.',self::$_includePaths,true))!==false) 

它运行良好,良好的Windows下,但在Linux下这是行不通的。我怀疑原因与case sensitive有关。如何解决它?谢谢。

回答

0

检查您\application\components目录

并键入正确的fileaneme HFooter.php

application.components.HFooter 
+0

感谢它的工作,但当我尝试基地浏览链接找不到。在它的窗口找到,idk在哪里是URL的路径yii。 –

+0

Yii1或Yii2请(看起来Yii1)?告诉我相关链接pelase?无论如何,如果代码世界意味着我回答你的问题..是公平的,然后标记我的答案为接受,并最终张贴另一个问题的新问题。 – scaisEdge

+0

是你的答案正确,对不起,即时通讯还是新的在stackoverflow,btw它仍然本地主机。所以你可以邀请你做客。 –

0

你是对的。在Linux中,文件和命令的名称与Windows不同,区分大小写。所以为了解决这个问题,你可以重命名你试图包含的文件或者用正确的大小写输入文件名。 你的情况你应该检查application.components.HFooter文件。可能它的名字不适用。像hfooter.php的Hfooter.php