主要问题是这样的,我在"/inc/smarty_inc.php"里做了以下操作:
//-----------------------------------------smarty_inc.php----------------
require_once('../comm/Smarty.class.php');
//缓存限制
session_cache_limiter("private_no_expire, max-page=1800");$smarty = new Smarty;
$smarty->template_dir = '../template/'; // 模板文件目录
$smarty->compile_dir = '../compile/'; // 编译文件目录
$smarty->cache_dir = '../cache/'; // 缓存文件目录
$smarty->config_dir = '../config/'; // 配置目录
$smarty->left_delimiter = "{!";
$smarty->right_delimiter = "!}";
$smarty->use_sub_dirs = false; // 是否生成子目录其中/comm/下是SMARTY文件然后在我的/WEB目录下里用include_once("../inc/smarty_inc.php")(当然还有其它的一些配置文件)
然后做相关付值处理,最后用$smarty->fetch("...")得到网页的内容,再定到文件,生成静态文件.先前没什么问题,一直写下去了,可是昨天我把模板更新了一下,重新生成时,生成的静态文件怎么也不能更新,还是老的模板生成的,我把/commpile文件夹内的文件全删除了(听网上的人这么说的)再重新生成静态文件时提示我:Warning: fetch(../compile/\%%77^774^774BE9C9%%index.html.php): failed to open stream: No such file or directory in F:\ftooo\comm\Smarty.class.php on line 1265Warning: fetch(): Failed opening '../compile/\%%77^774^774BE9C9%%index.html.php' for inclusion (include_path='.;c:\php4\pear') in F:\ftooo\comm\Smarty.class.php on line 1265我现在该怎么办呢,这倒低是怎么回事呀,急死我了
//-----------------------------------------smarty_inc.php----------------
require_once('../comm/Smarty.class.php');
//缓存限制
session_cache_limiter("private_no_expire, max-page=1800");$smarty = new Smarty;
$smarty->template_dir = '../template/'; // 模板文件目录
$smarty->compile_dir = '../compile/'; // 编译文件目录
$smarty->cache_dir = '../cache/'; // 缓存文件目录
$smarty->config_dir = '../config/'; // 配置目录
$smarty->left_delimiter = "{!";
$smarty->right_delimiter = "!}";
$smarty->use_sub_dirs = false; // 是否生成子目录其中/comm/下是SMARTY文件然后在我的/WEB目录下里用include_once("../inc/smarty_inc.php")(当然还有其它的一些配置文件)
然后做相关付值处理,最后用$smarty->fetch("...")得到网页的内容,再定到文件,生成静态文件.先前没什么问题,一直写下去了,可是昨天我把模板更新了一下,重新生成时,生成的静态文件怎么也不能更新,还是老的模板生成的,我把/commpile文件夹内的文件全删除了(听网上的人这么说的)再重新生成静态文件时提示我:Warning: fetch(../compile/\%%77^774^774BE9C9%%index.html.php): failed to open stream: No such file or directory in F:\ftooo\comm\Smarty.class.php on line 1265Warning: fetch(): Failed opening '../compile/\%%77^774^774BE9C9%%index.html.php' for inclusion (include_path='.;c:\php4\pear') in F:\ftooo\comm\Smarty.class.php on line 1265我现在该怎么办呢,这倒低是怎么回事呀,急死我了
应该不是权限的问题
是路径的问题~
$smarty->cache_dir = '../cache/'; // 缓存文件目录这两个目录同时清空试一下
这个文件夹权限要改一下:chmod 777 compile(UNIX 下命令);
不过看起来好像是路径出问题了,你可以看到你编译成后文件的路径名有问题的.
../compile (/\) %%77^774^774BE9C9%%index.html.php.
这里面应该是模板页面。例:a.tpl或a.html