![]() |
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 |
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. |
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.8) 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 |
All times are GMT -8. The time now is 07:54 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.