轉自:http://hi.baidu.com/lentimchen/blog/item/ea03df8032bc33cebd3e1eee.html
smarty3.0.7官網下載的demo運行報錯的解決方法
2011-04-12 22:39
從官網下載的smarty3.0.7版本運行,直接報如下錯誤:
/*%%SmartyNocache:221334da460b2356f10-15165135%%*//*/%%SmartyNocache:221334da460b2356f10-15165135%%*/
Fatal error: Uncaught exception 'SmartyCompilerException' with message 'Syntax Error in template "./templates/header.tpl" on line 3 "{popup_init src="/javascripts/overlib.js"}" unknown tag "popup_init"' in D:/cvsroot/tuan/Smarty3_07/libs/sysplugins/smarty_internal_templatecompilerbase.php:431 Stack trace: #0 D:/cvsroot/tuan/Smarty3_07/libs/sysplugins/smarty_internal_templatecompilerbase.php(253): Smarty_Internal_TemplateCompilerBase->trigger_template_error('unknown tag "po...', 3) #1 D:/cvsroot/tuan/Smarty3_07/libs/sysplugins/smarty_internal_templateparser.php(2319): Smarty_Internal_TemplateCompilerBase->compileTag('popup_init', Array) #2 D:/cvsroot/tuan/Smarty3_07/libs/sysplugins/smarty_internal_templateparser.php(2812): Smarty_Internal_Templateparser->yy_r35() #3 D:/cvsroot/tuan/Smarty3_07/libs/sysplugins/smarty_internal_templateparser.php(2912): Smarty_Internal_Templateparser->yy_reduce(35) #4 D:/cvsroot/tuan/Smarty3_07/libs/sysplugins/smarty_internal_smartytemplatecompiler.php(51): Smarty_Internal_Templatep in D:/cvsroot/tuan/Smarty3_07/libs/sysplugins/smarty_internal_templatecompilerbase.php on line 431
看提示是沒有找到popup_int標籤。
解決方式一:找到 /templates/header.tpl 文件,刪除掉{popup_init src="/javascripts/overlib.js"},運行OK。
方式二:產生上述錯誤的真正原因是沒有找到popup_int這個插件函數,有跟上一個版本比較了下,發現plugins文件夾裏面還真不存在function.popup_int.php、function.popup.php找個兩個函數,直接COPY,運行一起OK。