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

Can't get Smarty working

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


Joined: 19 Apr 2003
Posts: 1

PostPosted: Sat Apr 19, 2003 7:20 pm    Post subject: Can't get Smarty working Reply with quote

I installed Smarty, and walked through the setup instructions up to page 5, and got stuck. I got php to recognize smarty, and can instantiate an instance of the smarty object, but the moment I try and run any templates, I get the following errors:
Code:
Warning: stat failed for templates_c//%%117/%%1172603085/index.tpl.php (errno=13 - Permission denied) in /usr/local/psa/home/vhosts/imperfexion.org/httpdocs/smarty/libs/Smarty.class.php on line 1520

Warning: stat failed for templates_c//%%117/%%1172603085 (errno=13 - Permission denied) in /usr/local/psa/home/vhosts/imperfexion.org/httpdocs/smarty/libs/Smarty.class.php on line 2220

Warning: Smarty error: problem writing temporary file 'templates_c//%%117/%%1172603085/3ea19dd498f56' in /usr/local/psa/home/vhosts/imperfexion.org/httpdocs/smarty/libs/Smarty.class.php on line 1042

Warning: unable to create file templates_c//%%117/%%1172603085/index.tpl.php because Permission denied in /usr/local/psa/home/vhosts/imperfexion.org/httpdocs/smarty/libs/Smarty.class.php on line 1575

Warning: open_basedir restriction in effect. File is in wrong directory in /usr/local/psa/home/vhosts/imperfexion.org/httpdocs/smarty/libs/Smarty.class.php on line 1158

Warning: Failed opening 'templates_c//%%117/%%1172603085/index.tpl.php' for inclusion (include_path='.:') in /usr/local/psa/home/vhosts/imperfexion.org/httpdocs/smarty/libs/Smarty.class.php on line 1158


I've CHMODed the template and compile directories to 770, but beyond that I have no clue what I'm doing/not doing right.
Back to top
View user's profile Send private message
messju
Administrator


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

PostPosted: Sat Apr 19, 2003 7:33 pm    Post subject: Reply with quote

- try to set $smarty->compile_dir to an absolute path, to be sure smarty uses the one you chmod'ed.
- maybe chmod 770 is not enough to let the webserver write into templates_c. do chgrp ("nogroup" or "apache" or "wwwdata" or whatever your webserver runs) or try chmod 777 if you are not allowed to chgrp.
- if you run php's safe_modeset $smarty->use_sub_dirs to false.

HTH
messju
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Enquest
Smarty Regular


Joined: 14 May 2003
Posts: 79

PostPosted: Sat Jun 07, 2003 4:53 pm    Post subject: Reply with quote

The thing is this error can jump up without any reason. When I'm happaly coding and make a mistake with pointing a file to for example the wrong file

$smarty->assign('tbody', 'pl_view.tpl');
$smarty->display('index.tpl');

Then somehow Smarty doesn't want to write any longer to the template_c dir
I need to change the chmod again before it starts working again!

Is it a bug... Or is this normal?
_________________
-----------------------
Learning my self by trying to help others
Back to top
View user's profile Send private message
l3ean
Smarty n00b


Joined: 01 Oct 2005
Posts: 1

PostPosted: Sat Oct 01, 2005 7:25 pm    Post subject: chmodding...... Reply with quote

There are 3 numbers for chmodding of course - User, group, world (anonymous)

The user is YOU, the site owner - NOT PEOPLE LOGGED INTO YOUR SITE SCRIPT

777 means the user, the user's group, and anonymous people can read, write, and execute.

770 means only the user and the user's group can read, write and execute, but the anonymous people that use the site in their browser can't do anything.

Don't be scared if you give anonymous people the power to write. They can only do it by their browser and if you have some script that enables them to write.....such as when smarty writes the templates, they have to have read and write access but don't need execute access so I would chmodd these things 774.

Anyway, one of my clients is having the same problem with smarty and am about to try setting this absolute path.
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