/tmp/cache目录问题
我刚刚开始测试一些 php mvc 框架
,它有一个抛出错误的函数。 缓存目录从配置文件附加设置为 /tmp/cache
: PHP 托管在 IIS 服务器上。
有人可以帮助我以某种方式让它工作吗?
这是类中的函数
function setCacheDir($cacheDir = null)
{
if( is_null( $cacheDir ) )
{
$config = config::getInstance();
$cacheDir = $config->config_values['template']['cache_dir'];
}
if (is_dir($cacheDir) && is_writable($cacheDir))
{
$config = config::getInstance();
$this->cache_dir = $cacheDir;
}
else
{
throw new Exception("De cache directory '$cacheDir' either does not exist, or is unwriteble");
}
}
谢谢,理查德
I have just started out with testing some php mvc framework
In it, it has this function that throws an error.
The cachedirectory is set to /tmp/cache from the config file
additional:
The php is hosted on an IIS server.
Can someone help me out to get this working somehow?
This is the function within the class
function setCacheDir($cacheDir = null)
{
if( is_null( $cacheDir ) )
{
$config = config::getInstance();
$cacheDir = $config->config_values['template']['cache_dir'];
}
if (is_dir($cacheDir) && is_writable($cacheDir))
{
$config = config::getInstance();
$this->cache_dir = $cacheDir;
}
else
{
throw new Exception("De cache directory '$cacheDir' either does not exist, or is unwriteble");
}
}
thanks, Richard
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
为什么不将缓存目录设置为更适合 Windows 的目录,例如 c:\temp(并确保该文件夹存在)。
Why don't you set the cache directory to something a little more Windows-y, like c:\temp (and make sure that folder exists).
我猜测“/tmp/cache”不存在并且不可写,因此在配置文件中,将cache_dir设置为一个目录。
I'm guessing "/tmp/cache" doesn't exist and isn't writable, so in the configuration file, set cache_dir to a directory that is.
一些 PHP 框架在 LAMP 堆栈中工作得最好(或更好),第一个字母 (L) 是 Linux。如果您的框架文档建议使用 LAMP 堆栈,我会同意。
Some PHP frameworks work best (or better) in a LAMP stack, the first letter (L) being Linux. If the documentation of your framework advises a LAMP stack, I'd go with that.