2013-02-25 140 views
1

我剛開始在Windows 7機器上使用Yii框架。這給我這個惱人的錯誤,當我重新啓動計算機時,它會消失。 ?Yii框架錯誤 - 「未能打開流:權限被拒絕」

任何人都可以闡明發生了什麼,以及如何解決它的一些光..多謝

以下是錯誤我得到:

 

PHP warning 

copy(C:\www\corp\assets\96296f5a\js\ckeditor\plugins\imagepaste2.3.zip): failed to open stream: Permission denied 

C:\www\yii-1.1.13\framework\utils\CFileHelper.php(131) 

119 
120   $folder=opendir($src); 
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. 

Stack Trace 
#0 
+ 
C:\www\yii-1.1.13\framework\utils\CFileHelper.php(131): copy("C:\www\corp\protected\extensions\bootstrap\assets\js\ckeditor\pl...", "C:\www\corp\assets\96296f5a\js\ckeditor\plugins\imagepaste2.3.zi...") 
#1 
+ 
C:\www\yii-1.1.13\framework\utils\CFileHelper.php(136): CFileHelper::copyDirectoryRecursive("C:\www\corp\protected\extensions\bootstrap\assets\js\ckeditor\pl...", "C:\www\corp\assets\96296f5a\js\ckeditor\plugins", "/js/ckeditor/plugins", array(), ...) 
#2 
+ 
C:\www\yii-1.1.13\framework\utils\CFileHelper.php(136): CFileHelper::copyDirectoryRecursive("C:\www\corp\protected\extensions\bootstrap\assets\js\ckeditor", "C:\www\corp\assets\96296f5a\js\ckeditor", "/js/ckeditor", array(), ...) 
#3 
+ 
C:\www\yii-1.1.13\framework\utils\CFileHelper.php(136): CFileHelper::copyDirectoryRecursive("C:\www\corp\protected\extensions\bootstrap\assets\js", "C:\www\corp\assets\96296f5a\js", "/js", array(), ...) 
#4 
+ 
C:\www\yii-1.1.13\framework\utils\CFileHelper.php(63): CFileHelper::copyDirectoryRecursive("C:\www\corp\protected\extensions\bootstrap\assets", "C:\www\corp\assets\96296f5a", "", array(), ...) 
#5 
+ 
C:\www\yii-1.1.13\framework\web\CAssetManager.php(251): CFileHelper::copyDirectory("C:\www\corp\protected\extensions\bootstrap\assets", "C:\www\corp\assets\96296f5a", array("exclude" => array(".svn", ".gitignore"), "level" => -1, "newDirMode" => 511, "newFileMode" => 438)) 
#6 
– 
C:\www\corp\protected\extensions\bootstrap\components\Bootstrap.php(458): CAssetManager->publish("C:\www\corp\protected\extensions\bootstrap\assets", false, -1, true) 

453   if (isset($this->_assetsUrl)) 
454    return $this->_assetsUrl; 
455   else 
456   { 
457    $assetsPath = Yii::getPathOfAlias('bootstrap.assets'); 
458    $assetsUrl = Yii::app()->assetManager->publish($assetsPath, false, -1, YII_DEBUG); 
459    return $this->_assetsUrl = $assetsUrl; 
460   } 
461  } 
462 
463  /** 

#7 
– 
C:\www\corp\protected\extensions\bootstrap\components\Bootstrap.php(163): Bootstrap->getAssetsUrl() 

158  * @param string $cssFile the css file name to register 
159  * @param string $media the media that the CSS file should be applied to. If empty, it means all media types. 
160  */ 
161  public function registerAssetCss($cssFile, $media = '') 
162  { 
163   Yii::app()->getClientScript()->registerCssFile($this->getAssetsUrl() . "/css/{$cssFile}", $media); 
164  } 
165 
166  /** 
167  * Registers the core JavaScript. 
168  * @since 0.9.8 

#8 
– 
C:\www\corp\protected\extensions\bootstrap\components\Bootstrap.php(124): Bootstrap->registerAssetCss("bootstrap.css") 

119  /** 
120  * Registers the Bootstrap CSS. 
121  */ 
122  public function registerCoreCss() 
123  { 
124   $this->registerAssetCss('bootstrap' . (!YII_DEBUG ? '.min' : '') . '.css'); 
125  } 
126 
127  /** 
128  * Registers the Bootstrap responsive CSS. 
129  * @since 0.9.8 

#9 
+ 
C:\www\corp\protected\extensions\bootstrap\components\Bootstrap.php(102): Bootstrap->registerCoreCss() 
#10  
+ 
C:\www\yii-1.1.13\framework\base\CModule.php(387): Bootstrap->init() 
#11  
+ 
C:\www\yii-1.1.13\framework\base\CModule.php(523): CModule->getComponent("bootstrap") 
#12  
+ 
C:\www\yii-1.1.13\framework\base\CApplication.php(152): CModule->preloadComponents() 
#13  
+ 
C:\www\yii-1.1.13\framework\YiiBase.php(125): CApplication->__construct("C:\www\corp/protected/config/main.php") 
#14  
+ 
C:\www\yii-1.1.13\framework\YiiBase.php(98): YiiBase::createApplication("CWebApplication", "C:\www\corp/protected/config/main.php") 
#15  
+ 
C:\www\corp\index.php(13): YiiBase::createWebApplication("C:\www\corp/protected/config/main.php") 
2013-02-25 11:29:18 Apache/2.2.22 (Win32) PHP/5.3.13 Yii Framework/1.1.13 

+1

您沒有權限複製... 我認爲你不應該讓項目在驅動程序C ... – 2013-02-25 04:47:36

回答

1

錯誤基本上說,YII不能在運行時將所需的資產從擴展複製到資產目錄。

您的YII項目存在的目錄C:\www\corp應該可由Web服務器進程寫入。

我會看看是否有可能阻止Web服務器創建文件的防火牆/防病毒軟件。嘗試閱讀Web服務器日誌。

相關問題