CodeIgniter Forums
CI, SimplePie and server write permissions! - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: CI, SimplePie and server write permissions! (/showthread.php?tid=51285)



CI, SimplePie and server write permissions! - El Forum - 04-27-2012

[eluser]jk215[/eluser]
Hey everyone. Im trying to get Simplepie to cache results but I keep getting the dreaded "cache folder is unwritable" error.

Setup: Codeigniter 2.1.0 / PHP 5.2.x / Simplepie 1.2.1

I tried using the default ./cache directory listed in Simplepie and also my own cache folder outside of /application and /system. I am certain permissions are set at 777 right now.

I ran this little test:

Code:
function index()
    {
$this->load->helper('file');
        $data = 'Some file data';

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

It came back with unable to write the file. Is there something weird I need to know about CI writing to folders? Its pissing me off because everything works fine without cache but I need it! Any help is appreciated!



CI, SimplePie and server write permissions! - El Forum - 04-27-2012

[eluser]Aken[/eluser]
Use absolute paths, not HTTP paths when writing folders and files.


CI, SimplePie and server write permissions! - El Forum - 04-30-2012

[eluser]jk215[/eluser]
Yeah I think that was it. Used APPPATH instead and there is no more error. Thanks!