Smarty error: unable to read resource 这个错误是怎么回事? 检查你的模板文件index.tpl是否在./templates/这个目录下,并且是否有对此目录的操作权限。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 我昨天也碰到这个问题,非常郁闷,花费了不少时间,觉得没写错,xp下也不存在权限问题。总是提示这个错误:Smarty error: unable to read resource: "result.html",原来是因为有2个参数没设置:$s->compile_check = true;$s->debugging = false; 我也碰到这样的问题看了楼上几位的回答,有几个提问啊1.怎么查看权限啊,我觉得这个权限应该没什么问题。因为在其他范例中能得到预期结果2.更新下缓存是指清空cache中的文件吗3.$s->compile_check = true; $s->debugging = false;这两个参数在哪里设置呢 你的路径名有问题,我也遇到跟你一摸一样的问题。把下面的这段代码:require_once ( "../comm/Smarty.class.php "); $smarty = new Smarty(); $smarty-> template_dir = './templates/ '; $smarty-> compile_dir = './templates_c/ '; $smarty-> config_dir = './configs/ '; $smarty-> cache_dir = './cache/ '; 改写成://这里:E:/AppServ/www/ 是我的控制台路径,就是在http上输入localhost之后出现的位置。define('BASE_PATH', 'E:/AppServ/www/');//这里:Smarty/是 我的Smarty的安装位置,也就是define(‘SMARTY_PATH’,‘Smarty/’);//这里是Smarty.class.php的路径://合起来也就是:E:/AppServ/www/Smarty/Smarty.class.phprequire BASE_PATH.SMARTY_PATH.‘Smarty.class.php‘;$smarty=new Smarty();//下面的路径跟上面的差不多:$smarty->template_dir=BASE_PATH.SMARTY_PATH.‘templates/’;$smarty->complie_dir=BASE_PATH.SMARTY_PATH.’templates_c/‘;$smarty->config_dir=BASE_PATH.SMARTY_PATH.‘configs/’;$smarty->cache_dir=BASE_PATH.SMARTY_PATH.’cache/‘;总之你的路径一定要设置对了~就行~~ apc的问题求助 求一个简单的php查询语句 php文件上传 路径出错 文件后缀没有了 是什么情况 ... 哪里有open source的仿bewww.net网站源码 php 中的模擬多線程哦 ajax 刷新错误 请问面试时要做个什么样的网站 一个小问题,关于.的使用 文件上传问题 =============高薪急聘:PHP工程师============= 拿到了离职手续表,交上去就算正式离职了。郁闷,散分 PHP上传附件可以多大?
总是提示这个错误:Smarty error: unable to read resource: "result.html",
原来是因为有2个参数没设置:
$s->compile_check = true;
$s->debugging = false;
看了楼上几位的回答,有几个提问啊
1.怎么查看权限啊,我觉得这个权限应该没什么问题。因为在其他范例中能得到预期结果
2.更新下缓存是指清空cache中的文件吗
3.$s->compile_check = true; $s->debugging = false;这两个参数在哪里设置呢
require_once ( "../comm/Smarty.class.php "); $smarty = new Smarty();
$smarty-> template_dir = './templates/ ';
$smarty-> compile_dir = './templates_c/ ';
$smarty-> config_dir = './configs/ ';
$smarty-> cache_dir = './cache/ '; 改写成:
//这里:E:/AppServ/www/ 是我的控制台路径,就是在http上输入localhost之后出现的位置。
define('BASE_PATH', 'E:/AppServ/www/');
//这里:Smarty/是 我的Smarty的安装位置,也就是
define(‘SMARTY_PATH’,‘Smarty/’);//这里是Smarty.class.php的路径:
//合起来也就是:E:/AppServ/www/Smarty/Smarty.class.php
require BASE_PATH.SMARTY_PATH.‘Smarty.class.php‘;
$smarty=new Smarty();//下面的路径跟上面的差不多:
$smarty->template_dir=BASE_PATH.SMARTY_PATH.‘templates/’;
$smarty->complie_dir=BASE_PATH.SMARTY_PATH.’templates_c/‘;
$smarty->config_dir=BASE_PATH.SMARTY_PATH.‘configs/’;
$smarty->cache_dir=BASE_PATH.SMARTY_PATH.’cache/‘;总之你的路径一定要设置对了~就行~~