当前位置: 首页 > Notes > PHP > SAE使用smarty模板引擎报错的解决办法

SAE使用smarty模板引擎报错的解决办法

发布于:2015-1-7 PHP 3条评论 7,554 views
本站提供Linux服务器运维,自动化脚本编写等服务,如有需要请联系博主微信:xiaozme

最近使用smarty模板写一些小程序,想在SAE上进行测试,但是上传到SAE后出现了一些错误,错误信息为:“SAE_Fatal_error: Uncaught exception 'SmartyException' with message 'unable to write file ./...' ”,这是因为SAE平台无法进行文件读写操作造成。

sae

一、SAE给出了解决方案就是使用Memcache。首先进入应用中的应用管理中,在服务管理中开启Memcache一个初始化

二、修改Smarty的配置文件:

// For SAE 编译文件存放在memcache中
$smarty->compile_dir = 'saemc://smartytpl/';
$smarty->cache_dir = 'saemc://smartytpl/';
$smarty->compile_locking = false; // 防止调用touch,saemc会自动更新时间,不需要touch

三、最后smarty模板引擎就能成功的在SAE运行


标签: ,

回复 小z 取消回复

您的电子邮箱地址不会被公开。 必填项已用*标注


已有3条评论