Php Fopen Permision Issue

liunx

Guest
Hey,<br />I need some help,<br />I'm rewriting a script that parses an rss, to make my site load faster i'm adding code to cache what i need into a file. So that i only read it every hour rather than every page load.<br /><br />Here's what it says:<br /><!--quoteo--><div class='quotetop'>QUOTE</div><div class='quotemain'><!--quotec-->Warning: fopen(./cache/steam_news.cache) [function.fopen]: failed to open stream: Permission denied in file on line x<!--QuoteEnd--></div><!--QuoteEEnd--><br />line x looks like that:<br /><!--quoteo--><div class='quotetop'>QUOTE</div><div class='quotemain'><!--quotec-->if ( $the_file = fopen($cache_file, "w") ) {<!--QuoteEnd--></div><!--QuoteEEnd--><br /><br />so it can't open the file to read it. I would apreciate if someone told me if i have to change the chmod and to what. My concern is that i only want to give it the minimum permision to do that so that no one can modify that file other than the server.<br /><br />please let me know what i can do.<br />thanks in advance<!--content-->
it works if i set the chmod to 777 on the folder i wanna put the cache file into, but is that safe to do so?<!--content-->
Most scripts like forums and image galleries and so forth use 777 for a folder <br />so the script can write to the folder.<br /><br />Is it safe, maybe not , but what choice do we have.<!--content-->
okay thanks, i was just wondering if there was a safer way to do it.<!--content-->
 
Back
Top