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

error in simple program

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


Joined: 05 Jul 2003
Posts: 2

PostPosted: Sat Jul 05, 2003 4:30 pm    Post subject: error in simple program Reply with quote

hello! I''m running php 4.3.2 under windows xp pro. I'm using IIS as my web server. I have just installed smarty. I already uncommented the include_path in my php.ini file. I added a folder named includes and added the smarty/libs files.

heres my me.php file:

<html>
<body>
<?php

require( 'smarty.class.php' );
$smarty = new Smarty;

$smarty->assign('name', 'myname' );
$smarty->assign('address', 'myaddress' );

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

?>

</body>
</html>


heres my me.tpl file:

</html>
<body>
<B>HI! I am {$name}.<br />
I live in {$address}.</b>
</body>
</html>

everytime i view my me.php file, i get this error:

Warning: Smarty error: unable to read template resource: "me.tpl" in c:\php\includes\smarty.class.php on line 1042

chmod and chown are unrecognized by my computer. Is that normal for windows? Could you tell me what's wrong with my code? thanks!
Back to top
View user's profile Send private message
BlueTrin
Smarty Rookie


Joined: 05 Jul 2003
Posts: 9

PostPosted: Sun Jul 06, 2003 12:33 am    Post subject: Reply with quote

You ve done nothing wrong.

I've run your program without any problem, here's what I've done:

I ve created a folder called debug then the folders:
\debug\templates\
\debug\templates_c\

(check the permissions for templates_c folder, IIS should be able to write inside)

I've created the index.php INSIDE \debug\
I've created the me.tpl INSIDE \debug\templates\

then I opened my browser and went on http://yourwebserver.sthing/debug/me.php
and all went right.

PM me if after checking the folders and permissions it still does not work.
Back to top
View user's profile Send private message
paul_r
Smarty n00b


Joined: 05 Jul 2003
Posts: 2

PostPosted: Sun Jul 06, 2003 8:12 am    Post subject: Reply with quote

hey, it works! I enabled iis to write to that virtual directory. I have a couple of questions. Can I configure smarty to look in the same directory instead of the templates directory for the .tpl file? Where can I do so? And everytime I open the page, a new directory gets created in c:\. Its actually c:\%%743\%%743704862\me.tpl.php. What is this for? Thanks!
Back to top
View user's profile Send private message
BlueTrin
Smarty Rookie


Joined: 05 Jul 2003
Posts: 9

PostPosted: Sun Jul 06, 2003 11:19 am    Post subject: Reply with quote

http://www.phpinsider.com/smarty-forum/viewtopic.php?t=623
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