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 upon deleting cache files.

 
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 -> General
View previous topic :: View next topic  
Author Message
MrVon
Smarty Rookie


Joined: 08 Jul 2011
Posts: 15

PostPosted: Sun Mar 18, 2012 7:32 am    Post subject: Error upon deleting cache files. Reply with quote

Everything works okay however when i delete all files in templates_c folder and refresh page i get error.

After i refresh second time it error goes away.

Code:

Warning: include(/var/chroot/home/content/xx/xxxx/html/mysubdomain/templates_c/451f64349522d48a1678df3cc0f1c6d6d1093565.file.index.tpl.php) [function.include]: failed to open stream: No such file or directory in /home/content/xx/xxxx/html/mysubdomain/includes/smarty/sysplugins/smarty_internal_templatebase.php on line 161

Warning: include() [function.include]: Failed opening '/var/chroot/home/content/xx/xxxx/html/mysubdomain/templates_c/451f64349522d48a1678df3cc0f1c6d6d1093565.file.index.tpl.php' for inclusion (include_path='.:/usr/local/php5/lib/php') in /home/content/xx/xxxx/html/mysubdomain/includes/smarty/sysplugins/smarty_internal_templatebase.php on line 161

Fatal error: Uncaught exception 'SmartyException' with message 'Invalid compiled template for 'index.tpl'' in /home/content/xx/xxxx/html/mysubdomain/includes/smarty/sysplugins/smarty_internal_templatebase.php:174 Stack trace: #0 /home/content/xx/xxxx/html/mysubdomain/includes/smarty/sysplugins/smarty_internal_templatebase.php(374): Smarty_Internal_TemplateBase->fetch('index.tpl', NULL, NULL, NULL, true) #1 /home/content/xx/xxxx/html/mysubdomain/index.php(16): Smarty_Internal_TemplateBase->display('index.tpl') #2 {main} thrown in /home/content/xx/xxxx/html/mysubdomain/includes/smarty/sysplugins/smarty_internal_templatebase.php on line 174
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Sun Mar 18, 2012 9:23 am    Post subject: Reply with quote

We have seen this error before when the Smarty object was included in session variables. This is not possible as it does not save/restore the values of static varibales.

Is this what you have done?
Back to top
View user's profile Send private message
MrVon
Smarty Rookie


Joined: 08 Jul 2011
Posts: 15

PostPosted: Sun Mar 18, 2012 11:44 pm    Post subject: Reply with quote

I don't use session yet on that website.

It might be slow / too restricted hosting problem i use godaddy shared hosting. Sometimes very rarely i don't see this error when delete cache.

Another symptom is that it sometimes does not the site after changing template file and uploading and refreshing page, only without i delete cache. My templates_c folder chmod is 770

Thats my smarty setup in
Code:
includes/config.php


smarty is in
Code:
includes/smarty/Smarty.class.php


Code:
require_once('smarty/Smarty.class.php');
$ObjSmarty = new Smarty();

$ObjSmarty->setConfigDir($_SERVER['DOCUMENT_ROOT'].'/mysite/templates/config/');
$ObjSmarty->setTemplateDir($_SERVER['DOCUMENT_ROOT'].'/mysite/templates/');
$ObjSmarty->setCompileDir($_SERVER['DOCUMENT_ROOT'].'/mysite/templates_c/');
$ObjSmarty->setCacheDir($_SERVER['DOCUMENT_ROOT'].'/mysite/cache/');
//$ObjSmarty->debugging = true;
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Mon Mar 19, 2012 3:03 pm    Post subject: Reply with quote

If you modify template sources locally and upload them to the server it happens quiet often that you see not the chnages made, because your loacal and the servers system clocks are out of sync.

Make sure that the uploaded files get the timestamp of the server or delete cache and compiled files after uploading.
Back to top
View user's profile Send private message
MrVon
Smarty Rookie


Joined: 08 Jul 2011
Posts: 15

PostPosted: Mon Apr 09, 2012 1:52 am    Post subject: Reply with quote

I do delete all files in templates_c and i don't use cache so there's nothing else to delete.

Regarding time. when i run echo date_default_timezone_get(); it shows Sun, 08 Apr 2012 19:30:18 -0700 America/Phoenix they have -7 UTC and no daylight saving changes

I am in Los Angeles and my time is 19:30:18 as well however timezone is -8 UTC and +1 daylight saving changes so time is same.

So if i set php time zone to los angeles it will fix the problem or i need to change server time?
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 -> General 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