1

我正在尝试使用这两个框架创建一个简单的 RSS 解析器。但是,在尝试写入缓存目录时出现 PHPerrors:

set_cache_location(APPPATH.'cache/rss');

我正在使用来自 github 的最新版本 Simplepie 运行带有 XAMPP 的 Windows 7

错误:

遇到 PHP 错误

严重性:用户警告

消息:C:\xampp\htdocs\geekurls/system/application/cache/rss 不可写。确保您设置了正确的相对或绝对路径,并且该位置是服务器可写的。

文件名:库/simplepie.php

行号:1732

像下面的评论一样尝试并尝试制作测试文件但没有运气

        $file = APPPATH."cache/rss/testFile.txt";
        $handle = fopen($file, 'w') or die("fail");
        fclose($handle);
4

1 回答 1

1

一个简单的检查,找出可能发生的事情,

尝试使用标准 php 在此目录中创建一个文件 - 这可以帮助解决权限问题。

$this->load->helper('file'); 

$data = 'Some file data';

if ( ! write_file('./path/to/file.php', $data))
{
     echo 'Unable to write the file';
}
else
{
     echo 'File written!';
}

另外如何使用默认缓存?

http://simplepie.org/wiki/faq/i_m_getting_cache_error_messages

于 2010-06-06T15:31:33.567 回答