ernest1a — 2010-11-27T14:34:57-05:00 — #1
What rights do you usually set for uploaded images folder. Is normally 777 or 775?
rageh — 2010-11-27T14:40:56-05:00 — #2
I usually set 755 for image folders.
spence_noodle — 2010-11-27T15:34:13-05:00 — #3
I can confirm 755 is the best solution to use for image folder.
m_zeb_khan — 2010-11-28T05:59:10-05:00 — #4
I don't think 775 will work, if he is uploading files to this folder via a web based script such as PHP. You have to use 777 so the script has written permissions to upload images/files to that folder.
ernest1a — 2010-11-29T05:24:34-05:00 — #5
That is why I put this question. I have a sharing hosting and I set 775. Until last week everything worked for half year. But last week stoped and it says failed to open stream: Permission denied in...
So why it suddenly stopped working? I have never had any problems before on different hosting with 775 and image upload script. Will be a site less secure if I set to 777 now?
rubble — 2010-11-29T05:31:46-05:00 — #6
If your hosts have implimented phpsusex you will need to use 755 from memory. They should have notified you of the change.
ernest1a — 2010-11-29T06:08:03-05:00 — #7
With 775 I thought 755.
Rubble the thing is I used 755 before and now doesn't work anymore, so it is a reverse case. Is this my fault because I haven't used 777 from starting or their mistake because they didn't notify me? Should be used 777 from starting or only once 755 stoped working? I need to know that because my client is saying that is my fault.
thanks a lot!
mrwooster — 2010-11-29T08:45:17-05:00 — #8
The answer to this question really depends on your server setup, specifically how apache is run...
If apache is run by the user who owns the folder, then 755 will suffice.
If apache is run as a different user to the one who owns the folder, but is a member of the same user group, then 775 will suffice.
If apache is run as a different user and is not in the same user group as the folder owner..... 777.
shaydez — 2010-11-29T08:49:59-05:00 — #9
755 is the best for uploads. It really depends on your hosting company. Most hosting companies should have suPHP installed on their servers to prevent permission problems, if you're uploading via web you might get 999 (nobody).
(i'm still half asleep if the above response doesn't make sense)
aoberoi — 2010-12-04T01:37:34-05:00 — #10
i have a related topic (but specific to wordpress) here: http://www.sitepoint.com/forums/showthread.php?t=716627