使用 Codeigniter 写入权限 +简单派

发布于 2024-09-04 09:41:10 字数 596 浏览 5 评论 0原文

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

set_cache_location(APPPATH.'cache/rss');

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

错误:

遇到 PHP 错误

严重性:用户警告

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

文件名:libraries/simplepie.php

行号:1732

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

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

I am trying to create a simple RSS parser using the two frameworks. However I am getting PHPerrors when trying to write to my cache directory:

set_cache_location(APPPATH.'cache/rss');

I am running windows 7 with XAMPP using the latest version of Simplepie from github

error:

A PHP Error was encountered

Severity: User Warning

Message: C:\xampp\htdocs\geekurls/system/application/cache/rss is not writeable. Make sure you've set the correct relative or absolute path, and that the location is server-writable.

Filename: libraries/simplepie.php

Line Number: 1732

Tried like the below comment said and tried making a test file but to no luck

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

疑心病 2024-09-11 09:41:10

进行简单的检查以找出可能发生的情况,

尝试使用标准 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

A simple checks to find out what might be happening,

Try creating a file in this directory using standard php - this could help solve permission problems.

$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!';
}

Also how about using the default cache?

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

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