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

Unable to read resource

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


Joined: 15 Nov 2004
Posts: 1

PostPosted: Mon Nov 15, 2004 7:52 am    Post subject: Unable to read resource Reply with quote

Seriously, I've done a search for this error message and it seems to come up a lot. There has got to be a better way to do whatever it is Smarty needs to. I've never ran accross a script that asked me to set an include path in the php ini file. :/

Anyway...

I can require the smarty.class.php file just fine, but it can't ever find the templates directory unless I set both $template_dir and $compile_dir explicitly.

I figure this is just a rough workaround, I'm hoping I'm just not doing something right. Please excuse my placing templates in the web root. I'm just trying to get this damn thing working.

Files are located:

root = /webprojects/
smarty = /webprojects/hobbycode/smarty/
script = /webprojects/hobbycode/projects/

I have templates, templates_c, cache and configs under the smarty dir.

from my script in the script path above, I can simply:
[php:1:bccbc475c8]
require ('/webprojects/hobbycode/smarty/smarty.class.php");
[/php:1:bccbc475c8]

which gives no errors, but refuses to load any template.

How does smarty know where the templates dir is? How does it figure this out on it's own? Is setting the template_dir property the only solution?

apache 2/php 4.3.9/ win xp

Any help is appricated.

Thanks
Back to top
View user's profile Send private message
striker70
Smarty n00b


Joined: 27 Nov 2004
Posts: 4

PostPosted: Mon Nov 29, 2004 5:28 pm    Post subject: Did you ever find out what was causing it? Reply with quote

I'm having a similar problem.

It appears that smarty only works when it's in the root directory

I cant call smarty from another dirctory.

smarty location = /libs/smarty class
script calling smarty = /mydirectory/file name

if I do this to include it require '/libs/smarty.class.php';

IT pukes!
if I do this require '../libs/smarty.class.php';

IT pukes with error unable to find templates_c
I think that because it wants to look for templates_c in the directory I'm calling it from.

is there any way to set Scripts $_SERVER['DOCUMENT_ROOT'] / path name?

I have a feeling it's part of server configuration problem
Back to top
View user's profile Send private message Visit poster's website
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