已经将smarty2.6.24中libs考过去了,如图:
根据出错信息,感觉路径设置有问题,如图:
这个路径的/var/www/c868c.cn\mr\12\Smarty\\libs\Smarty.class.php中libs前两个反斜杠是不是有问题,有问题的话,程序怎么呢?
读者您好:
你是Linux系统,因此,config.php文件,您修改为这样,再试下。
<?php
function getpath(){
$mainpath=$_SERVER['DOCUMENT_ROOT'];
$filepath=$_SERVER['SCRIPT_FILENAME'];
$array=explode("/",$filepath);
$newarray=array();
for($i=0;$i<count($array)-1;$i++){
array_push($newarray,$array[$i]."/");
}
$abspath=implode("",$newarray);
$num=strlen($mainpath)-strlen($abspath);
$newpathtmp=substr($abspath,$num);
$newpath=$newpathtmp."Smarty/";
return($newpath);
}
$path=getpath();
define('BASE_PATH',$_SERVER['DOCUMENT_ROOT']);
define('SMARTY_PATH',$path);
require BASE_PATH.SMARTY_PATH.'libs/Smarty.class.php';
$smarty = new Smarty;
$smarty->template_dir = BASE_PATH.SMARTY_PATH.'templates/';
$smarty->compile_dir = BASE_PATH.SMARTY_PATH.'templates_c/';
$smarty->config_dir = BASE_PATH.SMARTY_PATH.'configs/';
$smarty->cache_dir = BASE_PATH.SMARTY_PATH.'cache/';
?>