|
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 |
rearcher Smarty n00b
Joined: 04 Oct 2011 Posts: 2 Location: Basking Ridge, NJ USA
|
Posted: Tue Oct 04, 2011 5:50 pm Post subject: Fatal error: Call to a member function SetTemplateDir() on |
|
|
I'm a rookie smarty user. I'm now attempting to install smarty for the first time. I can't seem to do a SetTemplateDir. Any advice would be appreciated. Thanks in advance.
Here is my test.php code
<?php
// Put full path to $smarty.class.php
require_once('/home/bjumc67/php/Smarty/Smarty.class.php');
$smarty = new Smarty();
//$smarty->debugging = true;
//$smarty->caching = true;
//$smarty->cache_lifetime = 120;
$smarty->testInstall();
$Smarty->SetTemplateDir('/www/rearcher.com/app1/templates/');
$Smarty->SetCompileDir('/www/rearcher.com/app1/templates_c/');
$Smarty->SetCacheDir('/www/rearcher.com/app1/cache/');
$Smarty->SetConfigDir('/www/rearcher.com/zpp1/config/');
//$smarty->testInstall();
$Smarty->assign('name','Russ');
$smarty->display('test.tpl');
?>
Here is what I get:
Smarty Installation test...
Testing template directory...
./templates/ is OK.
Testing compile directory...
./templates_c/ is OK.
Testing plugins directory...
Testing cache directory...
./cache/ is OK.
Testing configs directory...
./configs/ is OK.
Testing sysplugin files...
... OK
Testing plugin files...
... OK
Tests complete.
Fatal error: Call to a member function SetTemplateDir() on a non-object in /home/bjumc67/public_html/rearcher.com/test.php on line 13 |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Wed Oct 05, 2011 3:59 pm Post subject: |
|
|
Observe your cases
$smarty != $Smarty
and the camelcase methods name are like setTemplateDir |
|
Back to top |
|
rearcher Smarty n00b
Joined: 04 Oct 2011 Posts: 2 Location: Basking Ridge, NJ USA
|
Posted: Thu Oct 06, 2011 12:38 am Post subject: |
|
|
Thanks correct spelling made a world of difference.
I'm off to my next challenge. I have not figured out the chown to "nobody" requirement on my web server. It doesn't look like I have enough privileges to make that change.
Everything works if configs, ... are directly under /www/rearcher.com and I don't execute the "sets" ---but if I add a directory, say "app" (so the configs directory would be /www/rearcher.com/app") and put configs ... there I can't do the sets.
All the ownerships and privileges are identical for /www/rearcher.com/configs and /www/rearcher.com/app/configs
Sigh! |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Thu Oct 06, 2011 1:47 pm Post subject: |
|
|
changing file ownership requires root privileges. however, you should be able to change the permissions on the file to something the web server can read such as 644 for files or 755 for folders. If the web server needs write access, then use 666 for files and 777 for folders. |
|
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
|