首页 > 其他分享 >SAE部署Smarty出现:Uncaught exception 'SmartyException' with message 'unable to write

SAE部署Smarty出现:Uncaught exception 'SmartyException' with message 'unable to write

时间:2023-01-01 12:32:14浏览次数:41  
标签:templates exception SmartyException smarty Smarty path message SAE dir

对于SAE出现的问题:Uncaught exception 'SmartyException' with message 'unable to write file...。


官方给出了详细的FAQ:http://sae.sina.com.cn/?m=faqs&catId=11#show_213


解决方案为:



01  $path = "saemc://templates_c";
02 mkdir($path);
03
04 $smarty = new Smarty;
05 $smarty->template_dir = "./templates";
06 $smarty->compile_dir = $path;
07 .
08 .
09 .
10 $smarty->assign();
11 $smarty->display();



但注意的是,如果smarty中开启了缓存,即


1 $smarty->caching = true;



则也需要同样指定



view source
print ?
1 $smarty->cache_dir = "saemc://templates_c";


标签:templates,exception,SmartyException,smarty,Smarty,path,message,SAE,dir
From: https://blog.51cto.com/u_3457306/5982931

相关文章