Welcome Guest, Not a member yet? Register   Sign In
mkdir() warning in DB_cache.php
#1

[eluser]Akinzekeel[/eluser]
I regularly find this line in CI's event logs:
Code:
Severity: Warning --&gt; mkdir() [<a href='function.mkdir'>function.mkdir</a>]: File exists /homepages/1/d205918187/htdocs/XAlpha3/system/database/DB_cache.php 136


I checked line 136 in DB_cache.php and figured I might add a file_exists() to the if clause, so now I have:
Code:
if (! @file_exists($dir_path) and ! @mkdir($dir_path, DIR_WRITE_MODE))
{
    return FALSE;
}

Unfortunately that didn't solve the problem.

Database caching is disabled globally, but there are some parts of my code where I enable and disable it when running a certain active record query. Other than this warning, everything is working fine and caching itself is working too.

Any ideas why I still get this warning?

Edit: I'm using CI 1.7.2
#2

[eluser]theprodigy[/eluser]
Not exactly sure this would cause a warning or anything, but did you check the permissions? It looks like it's trying to create it with Write permissions. Maybe the dir is there but not writable.

Now, that doesn't explain why your file_exists isn't blocking it. Have you tried taking the @'s off and letting it complain a bit?
#3

[eluser]Akinzekeel[/eluser]
Thanks for your suggestions, I removed both @ signs and I also recursively chmod'ded the cache folder from 755 to 777.

Until now I have not seen the warning again, hopefully this solved the problem Smile




Theme © iAndrew 2016 - Forum software by © MyBB