我正在将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/