我得到以下错误filemtime(): stat failed。
完全错误是:
ERRNO: 2文本: filemtime():stat failed for C:\hatshop/presentation//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...") #第720行,文件: C:\hatshop\libs\smarty\sysplugins\smarty_resource.php Smarty_Template_Source.getCompiled(Object: Smarty_Internal_Template) #第654行,文件: C:\hatshop\libs\smarty\sysplugins\smarty_internal_template.php Smarty_Internal_Template.__get(“编译”)#第154行,文件: C:\hatshop\libs\smarty\sysplugins\smarty_internal_templatebase.php Smarty_Internal_TemplateBase.fetch(null,false,false,true) #第286行,文件: C:\hatshop\libs\smarty\sysplugins\smarty_internal_template.php Smarty_Internal_Template.getSubTemplate("departments_list.tpl",null,null,Array,"0") #第34行,文件: C:\hatshop\presentation\templates_c\3522bf5c12e26ac546fbfc3693da6da22f71f1d6.file.index.tpl.php content_5155dc5df33599_26514511(Object: Smarty_Internal_Template) #第180行文件: C:\hatshop\libs\smarty\sysplugins\smarty_internal_templatebase.php Smarty_Internal_TemplateBase.fetch("index.tpl",null,true) #第374行,文件: C:\hatshop\libs\smarty\sysplugins\smarty_internal_templatebase.php Smarty_Internal_TemplateBase.display("index.tpl") #第7行,文件: C:\hatshop\index.php
我读过很多关于这个问题的文章,但是他们中的大多数并不清楚如何应用这个解决方案,他们只是以一种非常不清楚的方式提出了一些建议。
发布于 2014-11-02 09:23:00
我通过添加以下内容解决了同样的错误:
$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
发布于 2013-03-30 01:33:23
我也看到过这样的错误,我认为这与像template_c这样的智能文件夹中的文件权限设置有关。因为Smarty试图确定我们是否可以使用缓存的文件,并尝试获取文件时间。请检查您的进程是否对文件夹具有正确的权限集。
发布于 2013-03-30 00:35:12
当注册的流包装器类没有定义的url_stat方法时,就会发生这种情况。在文档中还不清楚,但是PHP stat缓存需要这种方法。
https://stackoverflow.com/questions/15713414
复制相似问题