Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Smarty & templates_c errors (another cause & soultio

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 10-01-2003, 08:45 AM
 
pipercub pipercub is offline
 

Advanced Member
  
Join Date: Oct 2002
Posts: 82
 

Default Smarty & templates_c errors (another cause & soultio

Recently, I was having alot of Smarty errors. Specifically wit hthe templates_c directory. After making some changes to my configuration, the errors went away. All was good. However, about a week later, I began to get template_c errors again. This was confusing since I had made no changes during that time. Some more research pointed me to my server (shared server) file limits. I am allowed 200MB of disk space (which is fine). However, I am only allowed to have 10000 actual files. This is what was messing up templates_c. When Smarty writes to templates_c, it puts alot of files (and directories) there. This can put you over the top for your host plan (which will cause your server to generate an error), and it will cause template_c errors until you empty you templates_c cache (or remove other junk from your server).

The moral of this story is, be sure you check your _file limits_ for your host account. In my case, I had alot of junk (old versions of xcart) on my server. Removing this stuff seems to have worked. I'll now closely watch my file limit and empty the templates_c cache when (if) I get into the danger zone again.

Also, be careful! Some ISP's don't warn you before you go over your limits. If this is the case, you will probably be billed for anything over your plan limit.

Hope this helps anyone with similar problems.

Piper
Reply With Quote
  #2  
Old 10-02-2003, 05:19 AM
 
funkydunk funkydunk is offline
 

X-Man
  
Join Date: Oct 2002
Location: Cambridge, UK
Posts: 2,210
 

Default

also worth changing:

var $use_sub_dirs = true;

to

var $use_sub_dirs = false;

in Smarty.class.php in the smarty directory.

This will stopp all of the subdirectories being created with duplicates of the compiled templates.

Clean up your templates cache afterwards.
__________________
ex x-cart guru
Reply With Quote
  #3  
Old 10-03-2003, 10:16 AM
 
pipercub pipercub is offline
 

Advanced Member
  
Join Date: Oct 2002
Posts: 82
 

Default

Funkydunk,

That was one of the first things I changed when I began getting the errors and it fixed the problem until my file limits were reached (which was a totally different problem that resulted in templates_c errors). After cleaning out over 5000 un-needed files from my server, the new errors are gone. I believe it is now default (as of version 3.4. with the $use_sub_dirs = false.

From what I understand, with the sub directories turned on, there is a conflict with the PHP safe mode setting. For older xcart versions running with PHP safe_mode ON, it is probably essential to turn off sub directories. With safe_mode OFF, sub directories seem to be OK.

Another problem I had with safe_mode was that it was OFF for my main server space, but my security certificate (HTTPS) was on a different server with safe_mode truned ON. Everything worked fine for the customer until they entered the secure server. My ISP refused to disable safe_mode for that server. Needless to say, I'm now with a different provider.

Hope this helps anyone else who runs into the same issues.

Piper
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 08:35 PM.

   

 
X-Cart forums © 2001-2020