Welcome Guest, Not a member yet? Register   Sign In
Disabling the cache.
#1

[eluser]Ñuño Martínez[/eluser]
Hello.

I've updated my CI copy to version 1.6.2 and I've found an extrange issue.

I never used the cache system whith CI but since I've updated it the log file shows this line sometimes:

Code:
ERROR - 2008-05-19 17:36:13 --&gt; Severity: Warning  --&gt; fopen(~/projectname/system/cache/a87ff6blah...) [<a href='function.fopen'>function.fopen</a>]: failed to open stream: Permission denied ~/projectname/system/codeigniter/Common.php 49

I've changed the permissions for the cache subdirectory so I can find wich controller is looking for a cache (I'm pretty sure I haven't add a "$this->output->cache (n)" line nowhere) but it doesn't create a cache file! o_O

How can I find what controller is looking for a cache? Or how can I disable ALL caches?

Note: I start the development of this application using CodeIgniter 1.5.4
#2

[eluser]gtech[/eluser]
are you on a unix/linux type system? I came across this error the other day in the forum and remember doing a search (the answer is in these forums somewhere).

I seem to remeber its somthing to do with apache not having permissions to write to the filesystem

try and recursive chmod 0777 the root of your codeigniter install (where the index.php lives) and all subdirectories and see if that fixes the problem, or change the ownership so apache can access it.
#3

[eluser]Tom Glover[/eluser]
@Ñuño Martínez: welcome to the forum, are you on windows or nix?
#4

[eluser]Ñuño Martínez[/eluser]
Thanks for the responses
[quote author="gtech" date="1211236738"]are you on a unix/linux type system?[/quote] Linux.
[quote author="gtech" date="1211236738"]I seem to remeber its somthing to do with apache not having permissions to write to the filesystem

try and recursive chmod 0777 the root of your codeigniter install (where the index.php lives) and all subdirectories and see if that fixes the problem, or change the ownership so apache can access it.[/quote] I know and I did it. The error doesn't appears in the logs but no cache file is created! Why does it try to access to the cache?
#5

[eluser]Pascal Kriete[/eluser]
It always tries to access the cache, when it checks for an existing cache file.

Quote:Codeigniter.php, Line 106 => Output.php, Line 330 => Common.php, Line 49

That's the trace for you error. It's a permission issue, but not critical unless you decide to use the cache.
#6

[eluser]Ñuño Martínez[/eluser]
Oh, I forgot to say that I fix it. Just giving write permissions (ugo+w) to the cache subdirectory and it works now.

Thanks.
#7

[eluser]BaRzO[/eluser]
hi all
i am getting same Severity: Warning !!!
My config.php line 209
Code:
$config['cache_path'] = '';
using linux
maybe we should put a on/off switch for cache ?
Code:
$config['cache_output'] = false;
$config['cache_path'] = '';

i have checked Output library there is

Code:
function _write_cache($output)

    {

        $CI =& get_instance();    

<<< Check here if cache is enabled do cache buzz or Not >>>

        $path = $CI->config->item('cache_path');

    

        $cache_path = ($path == '') ? BASEPATH.'cache/' : $path;

        

        if ( ! is_dir($cache_path) OR ! is_really_writable($cache_path))

        {

            return;

        }

        

        $uri =    $CI->config->item('base_url').

                $CI->config->item('index_page').

                $CI->uri->uri_string();

        

        $cache_path .= md5($uri);



        if ( ! $fp = @fopen($cache_path, 'wb'))

        {

            log_message('error', "Unable to write cache file: ".$cache_path);

            return;

        }

        

        $expire = time() + ($this->cache_expiration * 60);

        

        flock($fp, LOCK_EX);

        fwrite($fp, $expire.'TS---&gt;'.$output);

        flock($fp, LOCK_UN);

        fclose($fp);

        @chmod($cache_path, DIR_WRITE_MODE);



        log_message('debug', "Cache file written: ".$cache_path);

    }



    // --------------------------------------------------------------------

this line never come up
log_message('error', "Unable to write cache file: ".$cache_path);


any idea ??
#8

[eluser]Ñuño Martínez[/eluser]
I think I didn't understand your post. Are you suggesting a fix to avoid the warning if cache isn't used?
#9

[eluser]BaRzO[/eluser]
i am suggesting if it is possible ci developers can put on/off method for caching ?




Theme © iAndrew 2016 - Forum software by © MyBB