|
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 |
smartt Smarty Rookie
Joined: 24 Jul 2003 Posts: 10 Location: Dresden, Germany
|
Posted: Thu Jul 24, 2003 8:49 am Post subject: Problems with Smarty under Windows and Apache |
|
|
Hi,
i try to set up Smarty on Windows using Apache 1.3. I`m just developing under windows, the productive system will be some unix system.
d:\htdocs is my document root.
d:\htdocs\smartytest is the folder everything is in (my index.php e.g.)
d:\htdocs\smartytest\smarty is the folder smarty is in (Smarty.class.php, the template directory and so on)
now i tried to set smarty up like described in the faqs. my index.php looks as follows:
<?
define("SMARTY_DIR","D:\\htdocs\\smartytest\\smarty\\");
require(SMARTY_DIR."Smarty.class.php");
$smarty = new Smarty;
$smarty->template_dir = "D:\\htdocs\\smartytest\\smarty\\templates";
$smarty->compile_dir = "D:\\htdocs\\smartytest\\smarty\\templates_c";
$smarty->config_dir = "D:\\htdocs\\smartytest\\smarty\\configs";
$smarty->assign("$name", "Charles");
$smarty->display("index.tpl");
?>
if i run index.php i get the following error:
Warning: Smarty error: unable to read template resource: "index.tpl" in D:\htdocs\smartytest\smarty\Smarty.class.php on line 1042
Whats the problem? I also like to mention, that i like to have the smartyfiles in document root, because most hosters only give you a single directory in the document root where all your files lie in.
thanks for any hints, Thomas |
|
Back to top |
|
smartt Smarty Rookie
Joined: 24 Jul 2003 Posts: 10 Location: Dresden, Germany
|
Posted: Thu Jul 24, 2003 9:41 am Post subject: |
|
|
i just discovered that:
echo $smarty->template_dir
shows:
templates
although i assigned
$smarty->template_dir = "D:\\htdocs\\smartytest\\smarty\\templates";
before! Why doesnīt work this?
regards, Thomas |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Thu Jul 24, 2003 9:59 am Post subject: |
|
|
is the above really a carbon-copy of your test code? maybe you accidently do a second "$smarty = new Smarty;" somewhere that resets your $smarty. |
|
Back to top |
|
smartt Smarty Rookie
Joined: 24 Jul 2003 Posts: 10 Location: Dresden, Germany
|
Posted: Thu Jul 24, 2003 10:13 am Post subject: |
|
|
yes you are right, i mistakely made a second instance of the smarty class. i really didnīt see that!
thank you for your help!
Thomas |
|
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
|