Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/289.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Smarty集缓存目录_Php_Caching_Smarty - Fatal编程技术网

Php Smarty集缓存目录

Php Smarty集缓存目录,php,caching,smarty,Php,Caching,Smarty,我将此目录下的子域subdomain1的内容迁移到一个新域2,就像新域:Domain2是第一个子域的相同副本一样。此域位于此目录下/var/www/vhosts/Domain2/httpdocs。 问题是,当我完成复制和重新配置新域后,我发现了一个小问题。当我键入新域url时,浏览器中会显示一条警告:警告:会话目录不存在:/var/www/vhosts/Domain1/subdomains/subdomain1/httpdocs/cache。在创建此目录之前,会话将不会工作。 尽管我创建了这个目

我将此目录下的子域
subdomain1
的内容迁移到一个新域2,就像新域:
Domain2
是第一个子域的相同副本一样。此域位于此目录下
/var/www/vhosts/Domain2/httpdocs
。 问题是,当我完成复制和重新配置新域后,我发现了一个小问题。当我键入新域url时,浏览器中会显示一条警告:
警告:会话目录不存在:/var/www/vhosts/Domain1/subdomains/subdomain1/httpdocs/cache。在创建此目录之前,会话将不会工作。
尽管我创建了这个目录(警告被解除),但会话没有启动,我的登录被拒绝。
我想重置Smarty的新目录,所以在一个php文件中,我尝试了以下方法

<?php
$smarty = new Smarty;
$smarty->setCacheDir('./cache');
echo $smarty->getCacheDir(); 
?>

知道如何重置Smarty目录(缓存目录)吗?Smarty版本是2.6.14

在Smarty 2中,您必须通过属性($Smarty->cache_dir)设置缓存目录。我首先尝试了这个方法,但是我收到了对未定义方法Smarty::cache_dir()的
调用。
您尝试过这样设置cache dir吗<代码>$smarty->cache_dir='./cache'
?啊,它能工作。。我以前试过这样做:set_cache_dir('./cache');但尽管如此,这个功能还是起了作用。。我仍然有相同的警告:会话目录不存在:/var/www/vhosts/Domain1/subdomains/subdomain1/httpdocs/cache。在创建此目录之前,会话将不会工作
Call to undefined method Smarty::setCacheDir()
Call to undefined method Smarty::getCacheDir()