/tmp/cache目录问题

发布于 2024-08-09 08:50:46 字数 776 浏览 6 评论 0原文

我刚刚开始测试一些 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

琉璃繁缕 2024-08-16 08:50:46

为什么不将缓存目录设置为更适合 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).

缱倦旧时光 2024-08-16 08:50:46

我猜测“/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.

晨光如昨 2024-08-16 08:50:46

一些 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文