我知道這個問題已經被覆蓋,如果我來這裏尋求幫助,這是因爲我在互聯網上找到的所有解決方案都沒有不爲我工作。Prestashop:SmartyException'帶消息'無法寫入文件...'
問題是以下幾點:
我正在使用Prestashop 1.6。我在本地開發了我的網站,一切正常,所以我決定把它放到網上。但是,移動數據庫和我的FTP網站後,我遇到了以下錯誤:
未捕獲的異常「SmartyException」有消息「無法寫入文件/ home /網絡/ chienchat /緩存/ smarty/compile/wrt53fc8900660ea3.68556794'in /home/web/chienchat/tools/smarty/sysplugins/smarty_internal_write_file.php:44 堆棧跟蹤:#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-> d isplay('/ 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 /家用/網絡/ chienchat /工具/智者/ sysplugins/smarty_internal_write_file.php上線44
我發現它可能是文件權限,所以對於測試的緣故,我已經設置CHMOD 777整個www,通過使用FileZilla。問題仍然存在。 我想指出,刪除緩存/ smarty文件夾後,並刷新非工作頁面後,文件夾緩存/ smarty /編譯是重新創建,但它是空的。請幫助我,我似乎無法解決任何問題。
我沒有安裝新的Prestashop,我將我的本地prestashop文件夾傳輸到我的網站。我需要直接重新安裝Prestashop嗎?順便說一下,我怎麼能確定我正在使用的Apache用戶是所需文件夾的所有者?我在我的ftp中創建了它們,並且我使用「root」用戶登錄到服務器,所以我非常肯定它很好,不是嗎?如何在無需再次安裝的情況下獲得環境兼容性檢查?我非常感謝你的關注。 我精確我沒有使用Linux或Ubuntu的,因此我不能像我在大多數互聯網主題上看到的那樣鍵入命令行。 – Malcom 2014-08-29 06:38:07
不,你不需要重新安裝PrestaShop。只要確保文件夾有權限。在大多數情況下,這是問題 - smarty不能寫入編譯文件夾(cache/smarty/compile)。您可以在BackOffice>高級參數>配置信息中查看它。 root用戶和apache用戶是兩個不同的用戶。 Root有訪問權限,但apache可能沒有。只需用755測試cache/smarty/compile即可。 – PrestaShopDeveloper 2014-08-29 07:08:36
我在每個文件夾和文件上都設置了CHMOD 755,但它不起作用。我嘗試了775,它也沒有工作。我無法訪問服務器上的後臺,因此我無法檢查配置信息。我能做什麼?我收到了一條新消息:我再次刪除了緩存/ smarty文件夾,但是當我刷新頁面時,文件夾沒有再次創建。將CHMOD 777放在「緩存」文件夾後,再次刷新頁面後,創建了文件夾cache/smarty和cache/smarty/compile,但後者爲空。 – Malcom 2014-08-29 08:18:45