exception - PHP和Smarty3-filemtime()[function.filemtime] : stat failed for

标签 exception error-handling smarty smarty3

我正在将WebAPP从Smarty2迁移到Smarty3。除了一个步骤,每一步都很容易。当我显示Smarty模板(tpl)时,将引发异常。

这条线
Source: /path_to_file/smarty/libs/sysplugins/smarty_resource.php (773)
(这是源代码udet_code)

文件不存在时引发此异常
$compiled->timestamp = @filemtime($compiled->filepath);
文件夹权限:

Smarty模板文件夹权限: 775

Smarty Cache文件夹权限: 775

文件夹所有者:

两者ftp_user:webserver_user

我正在尝试实现不同的解决方案,但似乎无法解决此问题,而无法更改 Php错误报告或禁用我的错误处理程序

没有黑客,我该如何解决这个问题?

最佳答案

您要做的不是降级到3.1.1,而是尝试升级到3.1.19版本。很多错误一直都在被删除,因此也许在此版本中您没有。

另一件事是,您可以使用muteExpectedErrors方法对Smarty隐藏文件系统警告(此功能的文档不是很清楚,但是会影响文件系统警告,在error_reporting文档中进行了解释)。您可以在error_reporting documentation页面上阅读:

Smarty 3.1.2 introduced the muteExpectedErrors() function. Calling Smarty::muteExpectedErrors(); after setting up custom error handling will ensure that warnings and notices (deliberately) produced by Smarty will not be passed to other custom error handlers. If your error logs are filling up with warnings regarding filemtime() or unlink() calls, please enable Smarty's error muting.

关于exception - PHP和Smarty3-filemtime()[function.filemtime] : stat failed for,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24785516/

相关文章:

c# - 捕获不同方法抛出的相同异常?

c++ - boost Mapped_file_source 会抛出哪些异常?

vbscript - 处理 VBScript 网站中未处理的错误?

php - 如何使用 smarty 检查服务器上是否存在图像?

php - {$foo|@print_r} 在屏幕上打印 '{$foo|@print_r}'

c# - 如何在异常中显示对象列表?

php - 绕过 mysqli_connect() 错误编写单元测试

php - 我正在尝试通过php函数转换xml数据,但出现解析器错误

mongoose - 如何独立处理 Mongoose 中多个唯一性的错误?

javascript - 如何在 smarty tpl 中使用 javascript 函数