在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/