Linux下 Smarty中的display顯示問題

來源:互聯網
上載者:User
在windows下好使,但是在linux下就不行了,我在linux下的路徑是\\192.168.73.112\ubuntu\usr\local\nginx\test。 所有的檔案都放在test下面。然後Smarty需要調用的HTML放在\\192.168.73.112\ubuntu\usr\local\nginx\test\View下。
我在linux下列印template_dir出來是/usr/local/nginx/test/View。

但是執行print_r($Smarty->template_dir); 這條出來了資訊,
$Smarty->display('index.html');但是卻沒有顯示介面。

誰能告訴我原因,只要相關的,靠譜的都告訴我。


回複討論(解決方案)

但是執行print_r($Smarty->template_dir); 這條出來了資訊
什麼內容,貼出來

但是執行print_r($Smarty->template_dir); 這條出來了資訊
什麼內容,貼出來

linux下是: /usr/local/nginx/test/View
windows下是:Array ( [0] => D:\wamp\www\KMBackgroud/View\ )

怎麼linux下和windows下列印出來的格式也不一樣

不好意思,上面的錯誤的了,這個是linux下列印出來的。
Array ( [0] => /usr/local/nginx/test/View/ ) 顯示1
Fatal error: Uncaught exception 'SmartyException' with message 'unable to write file /usr/local/nginx/test/Runtime/TemplatesCache_c/wrt4f694a4d12ab36.56330404' in /usr/local/nginx/test/Vender/Smarty/sysplugins/smarty_internal_write_file.php:44 Stack trace: #0 /usr/local/nginx/test/Vender/Smarty/sysplugins/smarty_internal_template.php(201): Smarty_Internal_Write_File::writeFile('/usr/local/ngin...', 'compileTemplateSource() #2 /usr/local/nginx/test/Vender/Smarty/sysplugins/smarty_internal_templatebase.php(374): Smarty_Internal_TemplateBase->fetch('index.html', NULL, NULL, NULL, true) #3 /usr/local/nginx/test/Controller/ControllerBase.class.php(126): Smarty_Internal_TemplateBase->display('index.html', NULL, NULL, NULL) #4 /usr/local/nginx/test/Controller/ControllerLogin.class.php(21): ControllerBase->display('index.html') #5 /usr/local/nginx/test/Controller/ControllerBase.cl in /usr/local/nginx/test/Vender/Smarty/sysplugins/smarty_internal_write_file.php on line 44

windows下面列印出來的
Array ( [0] => D:\wamp\www\KMBackgroud/View\ ) 顯示1 熊惠花 bbb

linux smarty中display的內容不能顯示,display之前的echo 能顯示,之後的不能

有木有許可權啊

樓上正解:在根目錄下執行 chmod -R 777 templates_c/

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.