小弟刚接触smarty,大家帮我看看
index.php:
include "smarty_inc.php";//调用smarty配置文件
$smarty = new Smarty;
$smarty->assign('articleTitle', 'Police begin campaign to rundown jaywalkers.');
$smarty->display('index.tpl');index.tpl:
<{$articleTitle|capitalize}>
显示:Fatal error: Smarty error: unable to write to $compile_dir '/smb/xujun/templates_c'. Be sure $compile_dir is writable by the web server user. in /smb/xujun/mysmarty/Smarty.class.php on line 1093
哪里出错了?
配置文件是这样:
require_once ("./mysmarty/Smarty.class.php");   
$smarty = new Smarty();                               $smarty->template_dir = './templates/';      
$smarty->compile_dir = './templates_c/';      
$smarty->config_dir    = './configs/';            $smarty->cache_dir    = './cache/';              $smarty->caching       = false;                    $smarty->left_delimiter = "<{";
$smarty->right_delimiter = "}>";
感激不尽!

解决方案 »

  1.   

    Fatal error: Smarty error: unable to write to $compile_dir '/smb/xujun/templates_c'. Be sure $compile_dir is writable by the web server user. in /smb/xujun/mysmarty/Smarty.class.php on line 1093很明显是目录不可写!
      

  2.   

    chmod  chown~~ for linux
      

  3.   

    显示:Fatal error: Smarty error: unable to write to $compile_dir '/smb/xujun/templates_c'. Be sure $compile_dir is writable by the web server user. in /smb/xujun/mysmarty/Smarty.class.php on line 1093确定此目录是否可写····改下权限把