Page 1 of 1

Help needed in smarty error

Posted: Mon Aug 24, 2009 1:45 am
by waseem83
Fatal error: Smarty error: the $compile_dir '/templates_c' does not exist, or is not a directory. in C:\xampp\htdocs\NS\smarty\libs\Smarty.class.php on line 1088.

Can any body resolve my this error ?

Re: Help needed in smarty error

Posted: Mon Aug 24, 2009 1:38 pm
by tr0gd0rr
Example 2-9 on http://www.smarty.net/manual/en/install ... .basic.php

You need to give smarty a directory where it will cache it's compiled templates.

Code: Select all

<?php
 
require_once(SMARTY_DIR . 'Smarty.class.php');
 
$smarty = new Smarty();
 
$smarty->template_dir = '/web/www.example.com/guestbook/templates/';
$smarty->compile_dir  = '/web/www.example.com/guestbook/templates_c/';
$smarty->config_dir   = '/web/www.example.com/guestbook/configs/';
$smarty->cache_dir    = '/web/www.example.com/guestbook/cache/';
 
$smarty->assign('name','Ned');
 
//** un-comment the following line to show the debug console
//$smarty->debugging = true;
 
$smarty->display('index.tpl');
 
?>

Re: Help needed in smarty error

Posted: Sun Aug 30, 2009 2:19 am
by cpetercarter
Remember too that the 'templates_c' directory must be writeable.