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

Installation Question

 
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
kuepper
Smarty n00b


Joined: 15 Dec 2004
Posts: 4

PostPosted: Wed Dec 15, 2004 2:16 am    Post subject: Installation Question Reply with quote

Hey,

I got this error just after installing Smarty:
Code:
Warning: Smarty error: unable to read resource: "index.tpl" in /home/chartse/public_html/smarty/Smarty.class.php on line 1088


Do I have to define these directories somewhere? I read this on the forum somewhere:

Quote:
Then instanciate your $smarty in a /home/users/mysite/config.php that also configures all paths like $smarty->template_dir, $smarty->compile_dir etc. Let all your pages below the document root include this config.php to get the $smarty instance.


How would I do this exactly?

Here's my current configuration:
/www/smarty/*
/www/smarty/internals/*
/www/smarty/plugins/*
/www/templates/
/www/templates_c/
/www/cache/

I would greatly appreciate any help! Thanks![/code]
Back to top
View user's profile Send private message Visit poster's website
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Wed Dec 15, 2004 9:13 am    Post subject: Reply with quote

$smarty->template_dir = '/www/templates';

and then put an index.tpl inside /www/templates
Back to top
View user's profile Send private message Send e-mail Visit poster's website
kuepper
Smarty n00b


Joined: 15 Dec 2004
Posts: 4

PostPosted: Wed Dec 15, 2004 5:54 pm    Post subject: Reply with quote

messju wrote:
$smarty->template_dir = '/www/templates';

and then put an index.tpl inside /www/templates


Thanks for the reply. I added the line of code you suggested to my index.php file located in /www/, so it now looks like this:

Code:

<?php

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

$smarty = new Smarty;

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

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

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


And I put the index.tpl file in the directory that you specified /www/templates/, and I still get the same error. Any ideas?

Thanks!
Back to top
View user's profile Send private message Visit poster's website
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Wed Dec 15, 2004 6:16 pm    Post subject: Reply with quote

you error message says "/home/chartse/public_html/" but your example says "/www/" ??
Back to top
View user's profile Send private message Send e-mail Visit poster's website
kuepper
Smarty n00b


Joined: 15 Dec 2004
Posts: 4

PostPosted: Thu Dec 16, 2004 6:43 pm    Post subject: Reply with quote

Hmm, yes, that's what I have and that's the error message I got. I'll try changing the /www/ to /public_html/ later today and see if that does the trick. Here's a link to the error: http://chartsetups.com/index.php .

Thanks!
Back to top
View user's profile Send private message Visit poster's website
kuepper
Smarty n00b


Joined: 15 Dec 2004
Posts: 4

PostPosted: Fri Dec 17, 2004 3:55 am    Post subject: Reply with quote

I tried changing it to:

Code:

<?php

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

$smarty = new Smarty;

$smarty->template_dir = '/public_html/templates/';
$smarty->compile_dir = '/public_html/templates_c/';
$smarty->config_dir = '/public_html/configs/';
$smarty->cache_dir = '/public_html/cache/';

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

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


... and it still gives me the same message. Any ideas??

Thanks!
Back to top
View user's profile Send private message Visit poster's website
Duncan
Smarty Pro


Joined: 16 Dec 2003
Posts: 166

PostPosted: Fri Dec 17, 2004 6:05 am    Post subject: Reply with quote

Try using absolute paths instead:

Code:

...

$smarty->template_dir = '/home/chartse/public_html/templates/';
$smarty->compile_dir = '/home/chartse/public_html/templates_c/';
$smarty->config_dir = '/home/chartse/public_html/configs/';
$smarty->cache_dir = '/home/chartse/public_html/cache/';

...


Also make sure that those dirs actually exist and are writeable by the webserver (templates_c and cache).
I'd recommend going through the crash course and reading up on the installation on smarty, which will help you out here.
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