jbenzakin Posted January 13, 2007 Posted January 13, 2007 Im trying to use smarty but im having trouble with it. if anyone can help me out. i uploaded the smarty folder downloaded on smarty.php.net in the root level. in my php file i set following path: require('/home/MY_USER_NAME/smarty/libs/Smarty.class.php'); then i have the following code: $smarty = new Smarty(); $filepath = MY_USER_NAME; $smarty->template_dir = '/home/' . $filepath . '/public_html/templates'; $smarty->compile_dir = '/home/' . $filepath . '/public_html/templates_c'; $smarty->cache_dir = '/home/' . $filepath . '/public_html/cache'; $smarty->config_dir = '/home/' . $filepath . '/public_html/configs'; i set chmod the templates_c and cache folder to 777 then i have this code: $page = 'index'; $section = 'index'; $smarty->assign('smarty', $smarty); $smarty->assign('page', $page); $smarty->assign('section', $section); $smarty->display('template.tpl'); i have a template called template.tpl inside the template forlder. and if i go to my site im getting the following error message: Warning: Smarty error: unable to read resource: "template.tpl" in /home/xhclznld/smarty/libs/Smarty.class.php on line 1095 PLEASE ANY HELP WILL BE APPRECIATED thanks jeremie Quote
TCH-Bruce Posted January 14, 2007 Posted January 14, 2007 Welcome to the forums Jeremie I'd recheck the install guide. Quote
jbenzakin Posted January 14, 2007 Author Posted January 14, 2007 Hi Bruce, i did. i use smarty at work everyday. already installed it several time. for some reason it wont work here. im not sure about the path im suppose to use on TCH Quote
TCH-Bruce Posted January 14, 2007 Posted January 14, 2007 I would try changing the statements that look like this to your actual path: >$smarty->template_dir = '/home/' . $filepath . '/public_html/templates'; to >$smarty->template_dir = '/home/yourCpanelName/public_html/templates'; Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.