|
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 |
vickriz Smarty Rookie
Joined: 27 May 2003 Posts: 16 Location: Philippines
|
Posted: Fri Mar 05, 2004 8:20 am Post subject: library files setup?? |
|
|
To smary guru..
im a newbie in linux. i read the manual of installation but i really hard to uunderstand where to put my smarty lib files and the Smarty directory. i dont know where to locate my include_path you where refering to. pls heelp me witth this regarding include_path and relative path.
heres my directory structure on linux:
placing my smarty lib file..[Smarty.class..,etc]
/usr/local/lib/php/Smarty
placing my smarty directory...[templates,cache, etc]
/var/www/htddocs/smarty/templates
...and i know its thee wrong place coz i really can''t follow where to put all this files.
and also i dont know what is my include_path.
is it /usr/local/include/ or /usr/include?? _________________
|
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Fri Mar 05, 2004 2:41 pm Post subject: |
|
|
The library directory is fine. If your document root is /var/www/htddocs, make the following:
/var/www/htdocs/index.php
/var/www/smarty/templates/
/var/www/smarty/templates_c/
/var/www/smarty/cache/
/var/www/smarty/configs/
Then in the /var/www/htdocs/index.php file:
[php:1:6a71c4a692]
<?php
require '/usr/local/lib/php/Smarty/Smarty.class.php';
$smarty =& new Smarty;
$smarty->template_dir = '/var/www/smarty/templates/';
$smarty->compile_dir = '/var/www/smarty/templates_c/';
$smarty->cache_dir = '/var/www/smarty/cache/';
$smarty->config_dir = '/var/www/smarty/configs/';
$smarty->display('index.tpl');
?>
[/php:1:6a71c4a692]
Make sure a /var/www/smarty/templates/index.tpl file exists, and templates_c is writable by your httpd process.
Monte |
|
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
|