这个问题,我已经解决,原因出在,这是D4PHP的一个BUG,D4PHP本意或许是用在liux或其他非win系统上来解决问题的,用在windows系统下,就有可能在使用smarty的时候出现找不到 /tmp 文件~
一个解决的方法: 修改vcl目录下的smartytemplate.inc.php文件~
在 function initialize() 中找到如下一句:
$this->_smarty->compile_dir = '/tmp';
改成如下即可:
if ( preg_match( "/^WIN/i", PHP_OS ) )
{
if ( isset( $_ENV['TMP'] ) )
{
$this->_smarty->compile_dir = $_ENV['TMP'];
} elseif( isset( $_ENV['TEMP'] ) ) {
$this->_smarty->compile_dir = $_ENV['TEMP'];
} else {
$this->_smarty->compile_dir = 'C:\TEMP';
}
} else {
$this->_smarty->compile_dir = '/tmp';
}
其中的C:\TEMP 文件夹,可以随意自行定义~~