Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

newbie trying to get it to work

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Installation and Setup
View previous topic :: View next topic  
Author Message
J4th77
Smarty n00b


Joined: 19 Feb 2004
Posts: 3

PostPosted: Thu Feb 19, 2004 11:36 pm    Post subject: newbie trying to get it to work Reply with quote

I've been following the Documentation and was able to get through chapter one now on to chapter 2 Extended setup:

This is the Error that I'm receiving:

Fatal error: Smarty error: the $cache_dir 'cache' does not exist, or is not a directory. in /usr/share/php/Smarty.class.php on line 1102

this is my setup.php:

<?
// load Smarty library
require('Smarty.class.php');

// The setup.php file is a good place to load
// required application library files, and you
// can do that right here. An example:
// require('mailer/mailer.lib.php');

class Smarty_mailer extends Smarty {

function Smarty_mailer() {

// Class Constructor. These automatically get set with each new instance.

$this->Smarty();

$smarty->template_dir =
'/srv/www/htdocs/test/mailer/templates';
$smarty->compile_dir =
'/srv/www/htdocs/test/mailer/templates_c/';
$smarty->config_dir =
'/srv/www/htdocs/test/mailer/configs/';
$smarty->cache_dir = '/srv/www/htdocs/test/mailer/cache/';

$this->caching = true;
$this->assign('app_name','mailer');
}

}

and this is my index.php:

<?
//Load Smarty Libary
require ('setup.php');
$smarty = new Smarty_mailer;



$smarty->assign('name','Ned');

$smarty->display('index.tpl');


any tips would be great. Thanks
Back to top
View user's profile Send private message
gdboling
Smarty Rookie


Joined: 20 Feb 2004
Posts: 31

PostPosted: Fri Feb 20, 2004 2:25 am    Post subject: Reply with quote

Do you have a folder called 'cache' in the path the you specified, /srv/www/htdocs/test/mailer/cache/'; ??
_________________
Gregg
Back to top
View user's profile Send private message
J4th77
Smarty n00b


Joined: 19 Feb 2004
Posts: 3

PostPosted: Fri Feb 20, 2004 3:08 pm    Post subject: Reply with quote

yes I do
Back to top
View user's profile Send private message
gdboling
Smarty Rookie


Joined: 20 Feb 2004
Posts: 31

PostPosted: Fri Feb 20, 2004 3:16 pm    Post subject: Reply with quote

Have you checked the permissions to make sure that your app has write permissions on that directory?
_________________
Gregg
Back to top
View user's profile Send private message
J4th77
Smarty n00b


Joined: 19 Feb 2004
Posts: 3

PostPosted: Fri Feb 20, 2004 3:43 pm    Post subject: Reply with quote

yes I tried chmod 770 & 775
Back to top
View user's profile Send private message
Duncan
Smarty Pro


Joined: 16 Dec 2003
Posts: 166

PostPosted: Fri Feb 20, 2004 5:44 pm    Post subject: Reply with quote

Make that 777 and it should work.
I assume the webserver is running under a different UID and therefor has to be writeable by the webserver user.
Back to top
View user's profile Send private message
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Fri Feb 20, 2004 9:52 pm    Post subject: Reply with quote

it sounds like this problem... http://www.phpinsider.com/smarty-forum/viewtopic.php?t=1519
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Installation and Setup All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP