Jump to content

Recommended Posts

Posted

Hey,

I need some help,

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.

 

Here's what it says:

Warning: fopen(./cache/steam_news.cache) [function.fopen]: failed to open stream: Permission denied in file on line x

line x looks like that:

if ( $the_file = fopen($cache_file, "w") ) {

 

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.

 

please let me know what i can do.

thanks in advance

Posted

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?

Posted

Most scripts like forums and image galleries and so forth use 777 for a folder

so the script can write to the folder.

 

Is it safe, maybe not , but what choice do we have.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...