【发布时间】:2014-07-16 16:04:38
【问题描述】:
我正在将我的 WebAPP 从 Smarty2 迁移到 Smarty3。每一步都很容易,除了一个。当我显示 Smarty 模板 ( tpl ) 时,会引发异常。
这一行
Source: /path_to_file/smarty/libs/sysplugins/smarty_resource.php (773)
(这是源代码$compiled->timestamp = @filemtime($compiled->filepath);)
当文件不存在时引发此异常
filemtime() [function.filemtime]: stat failed for /path_to_templates/smarty/templates_c/219dfe732aae7bd7c0edab091e3c53f3ce86b058.file.index.tpl.php
文件夹权限:
Smarty 模板文件夹权限:775
Smarty 缓存文件夹权限:775
文件夹所有者:
ftp_user:webserver_user
我正在尝试实施不同的解决方案,但似乎无法通过更改 Php 错误报告 或禁用我的 错误处理程序 来解决此问题。
如何在没有 hack 的情况下解决这个问题?
【问题讨论】:
-
更换版本后你清理
templates_c和cache目录了吗? -
是的,我愿意。这似乎是一个 Smarty 3.1.16 错误。切换到 Smarty 3.1.1,该错误不再出现。
标签: exception error-handling smarty smarty3