|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
J4th77 Smarty n00b
Joined: 19 Feb 2004 Posts: 3
|
Posted: Thu Feb 19, 2004 11:36 pm Post subject: newbie trying to get it to work |
|
|
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 |
|
gdboling Smarty Rookie
Joined: 20 Feb 2004 Posts: 31
|
Posted: Fri Feb 20, 2004 2:25 am Post subject: |
|
|
Do you have a folder called 'cache' in the path the you specified, /srv/www/htdocs/test/mailer/cache/'; ?? _________________ Gregg |
|
Back to top |
|
J4th77 Smarty n00b
Joined: 19 Feb 2004 Posts: 3
|
Posted: Fri Feb 20, 2004 3:08 pm Post subject: |
|
|
yes I do |
|
Back to top |
|
gdboling Smarty Rookie
Joined: 20 Feb 2004 Posts: 31
|
Posted: Fri Feb 20, 2004 3:16 pm Post subject: |
|
|
Have you checked the permissions to make sure that your app has write permissions on that directory? _________________ Gregg |
|
Back to top |
|
J4th77 Smarty n00b
Joined: 19 Feb 2004 Posts: 3
|
Posted: Fri Feb 20, 2004 3:43 pm Post subject: |
|
|
yes I tried chmod 770 & 775 |
|
Back to top |
|
Duncan Smarty Pro
Joined: 16 Dec 2003 Posts: 166
|
Posted: Fri Feb 20, 2004 5:44 pm Post subject: |
|
|
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 |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
|
Back to top |
|
|
|
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
|