Reputation: 478
I know this subject has already been covered, and if I come to ask for help here, it's because all the solutions I've found on the Internet didn't work for me.
The problem is the following :
I'm using Prestashop 1.6. I developed my website locally and everything worked just fine, so I decided to put it online. But after moving the database and the website on my FTP, I am encountering the following error :
Uncaught exception 'SmartyException' with message 'unable to write file /home/web/chienchat/cache/smarty/compile/wrt53fc8900660ea3.68556794' in /home/web/chienchat/tools/smarty/sysplugins/smarty_internal_write_file.php:44 Stack trace:#0 /home/web/chienchat/tools/smarty/sysplugins/smarty_internal_template.php(201): Smarty_Internal_Write_File::writeFile('/home/web/chien...', 'compileTemplateSource() #2 /home/web/chienchat/classes/module/Module.php(1860): Smarty_Internal_TemplateBase->fetch()#3 /home/web/chienchat/modules/blockuserinfo/blockuserinfo.php(72): ModuleCore->display('/home/web/chien...', 'blockuserinfo.t...')#4 /home/web/chienchat/classes/Hook.php(507): BlockUserInfo->hookDisplayTop(Array) #5 /home/web/chienchat/classes/controller/FrontController.php(444): HookCore::exec('displayTop') #6 /home/web/chienchat/controllers/front/IndexController.php(37): F in /home/web/chienchat/tools/smarty/sysplugins/smarty_internal_write_file.php on line 44
I found it could be the file permissions, so for the sake of testing I've set CHMOD 777 on the whole www, by using FileZilla. The problem is still here. I would like to point out that after deleting the cache/smarty folder, and after refreshing the non-working page, the folder cache/smarty/compile is anew created, but it is empty. Please help me, I can't seem to approach any solution.
Upvotes: 1
Views: 6723
Reputation: 611
This error can also occur if you use the filesystem cache. Many of the prestashop plugins are written in a way that causes a cache miss and store for lots of combinations of each page (page name, category name, language etc.) If you have a large number of products this can mean that you run over the Inode limit for the cache folder and you'll start to see this error, but only on first time visits to pages. Pages that were already in the cache will still render properly.
The solutions in this case are to
a) clear the cache b) fix all the cache ids for every module c) use an alternative caching strategy
A warning for c however - it doesn't fix the problem as the cache is still growing. It just takes away the filesystem limits on how many cache items you can hold. The best I can suggest for those suffering this problem is to automatically tail the log and clear the cache when this error occurs.
Upvotes: 1
Reputation: 3118
The correct permission is 755. If this does not work try with 775.
Also the apache user must be the owner of the required folders.
The folders are listed here: http://doc.prestashop.com/display/PS15/Installing+PrestaShop#InstallingPrestaShop-Systemcompatibility
Upvotes: 1