Page 1 of 1

Uploaded file CHMODed automatically to 600?

Posted: Fri Jan 20, 2006 1:38 am
by phice
I just setup a new server that seems to be working fine, but when I upload a file into a given directory the file is unable to viewed through the browser. And when I navigate to the file in FTP, I see that the file is CHMODed to 600 automatically. I have to manually change the CHMOD value to 644 to even be viewed by a webbrowser.

What do you think is wrong? How would I go about fixing this problem? I think it might have to do with what user PHP is running as, but I wouldn't know how to change that either.

Posted: Fri Jan 20, 2006 1:51 am
by phice
chmod() in the correct place always helps.

Posted: Fri Jan 20, 2006 3:43 am
by Chris Corbyn
FTP configurations often hold a Umask value of 022 (Opposite of CHMOD) or something. This means that by default uploaded files will have predefined permissions. It's also possible the sticky bit is set on the directory (chmod u+rwxs dirname). Check the FTP config for umask before doing anything else :)