Uploaded file CHMODed automatically to 600?

Whether you are using Linux on the desktop or as a server, it's still good that you're using Linux. Linux related questions go here.

Moderator: General Moderators

Post Reply
User avatar
phice
Moderator
Posts: 1416
Joined: Sat Apr 20, 2002 3:14 pm
Location: Dallas, TX
Contact:

Uploaded file CHMODed automatically to 600?

Post 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.
Image Image
User avatar
phice
Moderator
Posts: 1416
Joined: Sat Apr 20, 2002 3:14 pm
Location: Dallas, TX
Contact:

Post by phice »

chmod() in the correct place always helps.
Image Image
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post 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 :)
Post Reply