2013-03-30 33 views
1

我收到以下錯誤filemtime(): stat failedPHP和Smarty:filemtime():stat失敗

完整的錯誤是:

ERRNO:2 TEXT:filemtime():STAT失敗 C:\ hatshop /呈現// templates_c \ 74b952bedd7366ad261e8be04bc5be8ef15c2fc1.file.departments_list.tpl.php LOCATION: C:\ hatshop \ libs \ smarty \ sysplugins \ smarty_resource.php,行 720,在2013年3月30日12:14顯示回溯: filemtime(「C:\ hatshop/presentation // templates_c \ 74b952bedd7366ad261e8be04bc ... 「) #line 720,file:C:\ hatshop \ libs \ smarty \ sysplugins \ smarty_resource.php Smarty_Template_Source.getCompiled(Object:Smarty_Internal_Te mplate)# 線654,文件: C:\ hatshop \庫\智者\ sysplugins \ smarty_internal_template.php Smarty_Internal_Template .__獲得( 「編譯」)#線154,文件: C:\ hatshop \庫\智者\ sysplugins \ smarty_internal_templatebase.php Smarty_Internal_TemplateBase.fetch(NULL,NULL,NULL,NULL,假,假 ,真)#線286,文件: C:\ hatshop \庫\智者\ sysplugins \ smarty_internal_template.php Smarty_Internal_Template.getSubTemplate( 「departments_list.tpl」,null, null,null,null,Array [0],「0」)#line 34,file: C:\ hatshop \ presentation \ templates_c \ 3522bf5c12e26ac546fbfc3693da6da22f71f1d6.file.index.tpl.php content_5155dc5df33599_26514511(對象:Smarty_Internal _template)# 線180,文件: C:\ hatshop \庫\ smarty的\ sysplugins \ smarty_internal_templatebase.php Smarty_Internal_TemplateBase.fetch( 「在index.tpl」,NULL,NULL,NULL, 真)#線374,文件: C:\ hatshop \庫\ smarty的\ sysplugins \ smarty_internal_templatebase.php Smarty_Internal_TemplateBase.display( 「在index.tpl」)#線7,文件: C:\ hatshop \的index.php

我已讀很多帖子都在這個問題上,但其中大部分 都不清楚如何申請解決方案,他們只是在 建議的事情很不清楚。

回答

0

註冊流包裝類沒有定義url_stat方法時會發生這種情況。在文檔中尚不清楚,但這種方法是PHP stat緩存所必需的。

1

我也看到了這種錯誤,我認爲它與在smarty文件夾中設置的文件權限(如template_c)有關。因爲Smarty試圖確定我們是否可以使用緩存文件並嘗試獲取文件時間。請檢查你的進程正在對文件夾

2

正確設置權限的我有同樣的錯誤解決它通過添加:

$this->error_reporting = E_ALL & ~E_NOTICE; 
$this->muteExpectedErrors(); 

我application.php

<?php 

// Reference Smarty library 
require_once SMARTY_DIR . 'Smarty.class.php'; 

/* Class that extends Smarty, used to process and display Smarty 
    files */ 

class Application extends Smarty { 

    // Class constructor 
    public function __construct() { 
     // Call Smarty's constructor 
     parent::__construct(); 

     $this->error_reporting = E_ALL & ~E_NOTICE; 
     $this->muteExpectedErrors(); 

     // Change the default template directories 
     $this->template_dir = TEMPLATE_DIR; 
     $this->compile_dir = COMPILE_DIR; 
     $this->config_dir = CONFIG_DIR; 
     $this->addPluginsDir(SMARTY_DIR . 'plugins'); 
     $this->addPluginsDir(PRESENTATION_DIR . 'smarty_plugins'); 
    } 

} 

?> 

做檢查此鏈接:

http://www.smarty.net/forums/viewtopic.php?t=21352&sid=88c6bbab5fb1fd84d3e4f18857d3d10e

0

去TH e聰明的資源文件(C:\ hatshop \ libs \ smarty \ sysplugins \ smarty_resource。PHP)和720前行:從這個 改變它(720 $ compiled->時間戳= @filemtime($ compiled->文件路徑):

$compiled->timestamp = @filemtime($compiled->filepath; 

if(file_exists($compiled->filepath)) 
$compiled->timestamp = @filemtime($compiled->filepath;