在新浪云SAE中使用smarty引擎模版

  在新浪云上使用smarty时会发现又这样的错误信息:

  “SAE_Fatal_error: Uncaught exception 'SmartyException' with message 'unable to write file ./web/templates_c/wrt4e95555280ef1' ”。

  这是因为不能使用官方下载的smarty文件包,要下载smarty for sae的专门版本,地址:http://code.google.com/p/smarty4sae/downloads/list

  然后拷贝其中的libs文件夹,替换即可。

  接着,在sae相应的项目中找到Mecache,并开启。

  

  再更改smarty配置文件中的编译目录和缓存目录如下:

1 $smarty->compile_dir = 'saemc://smartytpl/';
2 $smarty->cache_dir = 'saemc://smartytpl/';
3 smarty->compile_locking =  false; // 防止调用touch,saemc会自动更新时间,不需要touch

 

posted @ 2014-08-14 11:04  Jmingzi  阅读(336)  评论(0编辑  收藏  举报