看官网说最好不要把smarty放在根目录下,结果就遇到坑了。。。
各种权限,路径问题。被弄的苦不堪呀,最后还是选择放在根目录下/home/www/htdocs/smarty下吧
路径选择相对路径,什么bug都没了。
include("smarty/libs/Smarty.class.php");
$smarty = new Smarty();
$smarty->template_dir="smarty/templates/";
$smarty->compile_dir="smarty/templates_c/";
$smarty->config_dir="smarty/configs/";
$smarty->cache_dir="smarty/cache/";