简体   繁体   English

/ tmp / cache目录问题

[英]/tmp/cache directory problem

I have just started out with testing some php mvc framework 我刚开始测试一些php mvc框架

In it, it has this function that throws an error. 在其中,它具有引发错误的功能。 The cachedirectory is set to /tmp/cache from the config file 从配置文件将cachedirectory设置为/ tmp / cache

additional: The php is hosted on an IIS serve r. 另外:php托管在IIS服务器 r上。

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 谢谢,理查德

为什么不将缓存目录设置为Windows-y,例如c:\\ temp(并确保该文件夹存在)。

我猜“ / tmp / cache”不存在并且不可写,因此在配置文件中,将cache_dir设置为一个目录。

Some PHP frameworks work best (or better) in a LAMP stack, the first letter (L) being Linux. 一些PHP框架在LAMP堆栈中工作得最好(或更好),第一个字母(L)是Linux。 If the documentation of your framework advises a LAMP stack, I'd go with that. 如果您的框架文档建议使用LAMP堆栈,那我就去做。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM