Welcome Guest, Not a member yet? Register   Sign In
No Caching but still getting Warnings in the log
#1

[eluser]dmorin[/eluser]
Just wondering if this is normal, or if I have something configured incorrectly.

I'm not currently using caching on any page, but in my logs I'm getting the following error:

Quote:ERROR - 2008-02-05 20:34:04 --&gt; Severity: Warning --&gt; fopen(/var/www/html/system/cache/3ef815416f775098fe977004015c6193) [<a href='function.fopen'>function.fopen</a>]: failed to open stream: Permission denied /var/www/html/system/codeigniter/Common.php 49

If you have any ideas, please let me know. Thanks.
#2

[eluser]Seppo[/eluser]
What CI version are you running?

I haven't anything like a fopen in all Common.php file.
#3

[eluser]dmorin[/eluser]
The newest, 1.6.

I just upgraded and at the same time I enabled logging of errors, so I'm not sure if it was caused by the upgrade or it has always been there.

Also, the cache directory does exist and the only thing in it is the default index.html file.
#4

[eluser]Seppo[/eluser]
Oh! I see what's going on now...
CI attempts to create a file to check if the directory is writeable or not... I can say it is a common error and the only problem is that the cache dir is not writeable.
#5

[eluser]dmorin[/eluser]
So I guess the question would then be, if caching is not enabled for the controller, why is it testing the write-ability of the cache directory? It seems like this is a waste of resources. Even Database caching is set to false, so that shouldn't be triggering it either.

It looks like the 'is_really_writable' function is being called when it tries to display the cache. Is it really more resource efficient to check if the directory is writable rather than just calculating the md5 hash and checking to see if the cache file exists?
#6

[eluser]Seppo[/eluser]
It is called before the controllers and all the processing, checking for cache files to output instead of processing. There is no way to now, at that point, if the page is being cached.
"is_really_writable" call is one of the test CI makes to know that.
#7

[eluser]dmorin[/eluser]
Right, I understand it cannot know if a page is being cached or not at that point. What I'm asking is, because write speeds on drives is slower than read speeds, does it make sense to check and see if the cache directory is writable before trying to read in a cache file versus just checking to see if the cache file exists without seeing if the directory is writable?

Maybe this is negligible but it seems like minimizing writes to the disk would be ideal. Maybe I've just been thinking about scaling databases too long...




Theme © iAndrew 2016 - Forum software by © MyBB