人气好低阿!求助SMARTY

软件和网站开发以及相关技术探讨
回复
lshguang89
帖子: 61
注册时间: 2007-07-11 18:51
来自: SYSU

人气好低阿!求助SMARTY

#1

帖子 lshguang89 » 2007-12-23 19:50

系统是Ubuntu 7.10
smarty 安装包 中的libs/的文件放在 /usr/local/lib/php/Smarty/中
apache 服务器目录是 /home/lshg/desktop/testphp/
这是index.php文件中的一段
$smarty->template_dir = ' /home/lshg/desktop/testphp/smarty/templates/';
$smarty->compile_dir = ' /home/lshg/desktop/testphp/smarty/templates_c/';
$smarty->cache_dir = ' /home/lshg/desktop/testphp/smarty/cache/';
$smarty->config_dir = ' /home/lshg/desktop/testphp/smarty/configs/';

$smarty->assign('name', 'Ned');
$smarty->display('index.tpl');
执行后提示找不到 unable to read resource: "index.tpl" in /usr/local/lib/php/Smarty/Smarty.class.php on line 1095
请问怎么办?
已经上网搜过 没有找到解决办法
头像
SuperWar3Fan
帖子: 1263
注册时间: 2006-05-20 6:25
来自: 山东淄博
联系:

#2

帖子 SuperWar3Fan » 2008-01-16 10:05

index.php应该和index.tpl在一个目录下面啊!
或者干脆把smart拷贝到你的Web目录下面一样用!
有空的话,请访问我的BlogUbuntu高地
nameliba
帖子: 2
注册时间: 2007-11-19 14:20

#3

帖子 nameliba » 2008-01-17 9:10

home/lshg/desktop/testphp/smarty/templates/ index.tpl 文件是否存在.
回复