在调试模式下添加扩展获取:“chmod():不允许操作”

时间:2013-04-23 14:41:29

标签: php yii file-permissions yii-extensions font-awesome

当我向Yii添加扩展名(EfontAwesome,ref:www.yiiframework.com/extension/efontawesome)时,我得到“chmod():不允许操作”
Call Stack看起来像这样......

/opt/lampp/htdocs/yii-1.1.13/framework/utils/CFileHelper.php(133)

121         while(($file=readdir($folder))!==false)
122         {
123             if($file==='.' || $file==='..')
124                 continue;
125             $path=$src.DIRECTORY_SEPARATOR.$file;
126             $isFile=is_file($path);
127             if(self::validatePath($base,$file,$isFile,$fileTypes,$exclude))
128             {
129                 if($isFile)
130                 {
131                     copy($path,$dst.DIRECTORY_SEPARATOR.$file);
132                     if(isset($options['newFileMode']))
133                         chmod($dst.DIRECTORY_SEPARATOR.$file,$options['newFileMode']);
134                 }
135                 elseif($level)
136                     self::copyDirectoryRecursive($path,$dst.DIRECTORY_SEPARATOR.$file,$base.'/'.$file,$fileTypes,$exclude,$level-1,$options);
137             }
138         }
139         closedir($folder);
140     }
141 
142     /**
143      * Returns the files found under the specified directory and subdirectories.
144      * This method is mainly used by {@link findFiles}.
145      * @param string $dir the source directory
Stack Trace
#0  
+  /opt/lampp/htdocs/yii-1.1.13/framework/utils/CFileHelper.php(133): chmod("/opt/lampp/htdocs/im/assets/6950b6ca/css/font-awesome.css", 438)
#1  
+  /opt/lampp/htdocs/yii-1.1.13/framework/utils/CFileHelper.php(136): CFileHelper::copyDirectoryRecursive("/opt/lampp/htdocs/im/protected/extensions/EFontAwesome/assets/cs...", "/opt/lampp/htdocs/im/assets/6950b6ca/css", "/css", array(), ...)
#2  
+  /opt/lampp/htdocs/yii-1.1.13/framework/utils/CFileHelper.php(63): CFileHelper::copyDirectoryRecursive("/opt/lampp/htdocs/im/protected/extensions/EFontAwesome/assets", "/opt/lampp/htdocs/im/assets/6950b6ca", "", array(), ...)
#3  
+  /opt/lampp/htdocs/yii-1.1.13/framework/web/CAssetManager.php(251): CFileHelper::copyDirectory("/opt/lampp/htdocs/im/protected/extensions/EFontAwesome/assets", "/opt/lampp/htdocs/im/assets/6950b6ca", array("exclude" => array(".svn", ".gitignore"), "level" => -1, "newDirMode" => 511, "newFileMode" => 438))
#4  
–  /opt/lampp/htdocs/im/protected/extensions/EFontAwesome/components/EFontAwesome.php(41): CAssetManager->publish("/opt/lampp/htdocs/im/protected/extensions/EFontAwesome/assets", false, -1, true)
36     public function getAssetsUrl() {
37         if (isset($this->_assetsUrl))
38             return $this->_assetsUrl;
39         else {
40             $assetsPath = Yii::getPathOfAlias('efontawesome.assets');
41             $assetsUrl = Yii::app()->assetManager->publish($assetsPath, false, -1, YII_DEBUG);
42             return $this->_assetsUrl = $assetsUrl;
43         }
44     }
45 }

这只发生在调试模式而不是生产模式。 该目录可由Web进程写入(因为它可以看作在生产模式下工作),这个扩展在几天前在调试模式下运行良好,

一个简短的谷歌搜索只在github上买了这个已关闭的问题:https://github.com/yiisoft/yii/issues/1853关于forcedCopy和linkAssets配置冲突,这在Yii-1.1.13(我正在使用的版本)中修复,只是为了安全我也尝试在主配置文件中将两者的配置设置为false,如此

'assetManager' => array(
            'linkAssets' => false,
            'forceCopy'=>false,
        ),

但问题是持续存在,有关如何解决此问题的任何想法?

0 个答案:

没有答案