第一次运行的时候不报错刷新一下就报错
cache.tpl
{name}
嘿嘿 我是被缓存的哟
index.php
<?php
require_once ("./libs/Smarty.class.php");
function smarty_function_name($params,&$smarty){
return date("Y-m-d H:m:s")."<br>";
}
$smarty = new Smarty();
$smarty->template_dir = './templates/';
$smarty->compile_dir = './templates_c/';
$smarty->config_dir = './configs/';
$smarty->cache_dir = './cache/';
$smarty->cache_lifetime =2;
$smarty->caching = true;
$smarty->register_function("name","smarty_function_name",false);
$smarty->display('cache.tpl');
?>
报错内容如下:
Warning: Smarty::include_once(./templates_c/\%%E8^E8A^E8A3669C%%cache.tpl.inc) [function.Smarty-include-once]: failed to open stream: No such file or directory in D:\AppServ\www\smarty\libs\Smarty.class.php on line 1923Warning: Smarty::include_once() [function.include]: Failed opening './templates_c/\%%E8^E8A^E8A3669C%%cache.tpl.inc' for inclusion (include_path='.;D:\AppServ\php5\pear') in D:\AppServ\www\smarty\libs\Smarty.class.php on line 1923
{nocache:68f51390ee008f2ec19b4ca13351358b#0} 嘿嘿 我是被缓存的哟
cache.tpl
{name}
嘿嘿 我是被缓存的哟
index.php
<?php
require_once ("./libs/Smarty.class.php");
function smarty_function_name($params,&$smarty){
return date("Y-m-d H:m:s")."<br>";
}
$smarty = new Smarty();
$smarty->template_dir = './templates/';
$smarty->compile_dir = './templates_c/';
$smarty->config_dir = './configs/';
$smarty->cache_dir = './cache/';
$smarty->cache_lifetime =2;
$smarty->caching = true;
$smarty->register_function("name","smarty_function_name",false);
$smarty->display('cache.tpl');
?>
报错内容如下:
Warning: Smarty::include_once(./templates_c/\%%E8^E8A^E8A3669C%%cache.tpl.inc) [function.Smarty-include-once]: failed to open stream: No such file or directory in D:\AppServ\www\smarty\libs\Smarty.class.php on line 1923Warning: Smarty::include_once() [function.include]: Failed opening './templates_c/\%%E8^E8A^E8A3669C%%cache.tpl.inc' for inclusion (include_path='.;D:\AppServ\php5\pear') in D:\AppServ\www\smarty\libs\Smarty.class.php on line 1923
{nocache:68f51390ee008f2ec19b4ca13351358b#0} 嘿嘿 我是被缓存的哟
解决方案 »
- PHP的功能已经实现,却总是报错
- 麦小偷 小偷程序 是怎么实现原理的
- 求高手帮忙解决网站问题
- 如何用异步方式执行函数?
- php snoopy采集遇到的问题 :bad request your browser sent a request that this server could not understand
- $_GET 取得 URL的一个参数时,如何不分大小写?
- 討論:如何用GD生成高DPI值的圖像?
- 向高手请教关于缓存的机制及用法
- 新手求救!!!经典书籍!!!!再现等待!高分奉送!!!
- calhost/mytrain/traindata.php?action=list&start=%E5%8C%97%E4%BA%AC&end=%E4%B8%8A
- 诚聘网站PHP工程师,主要为网站B/S系统程序开发
- update条件无效
我路径没有写错啊 我要是用insert缓存控制就不报错
应该怎么写呢