Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm sorry if there is already 100 answers out there about this, but they just got me confused. I've a working php-script that allows me to upload images to the webserver when I'm logged in to a CMS. Right now I've 777 permissions to the upload folder and I heard that not very good.

To make it little more safe I'm trying to set the folder permissions to 744 and set the apache server( shared host) to the owner of the folder. Is that sufficient secure?

Then, If I make a folder with PHP: mkdir('imageFolder', 0744); That should create a folder with those settings, right? But when I tried to delete/change that folder in my ftp-program it worked. How is it that the ftp can change a folder if the apache is the owner?

share|improve this question

migrated from stackoverflow.com Jun 16 '12 at 10:43

This question came from our site for professional and enthusiast programmers.

is the ftp accessing/deleting as root? –  Chasing Death Jun 16 '12 at 7:04
Are you sure it created the folder with the correct permissions? –  dpk2442 Jun 16 '12 at 7:08
"How is it that the ftp can change a folder if the apache is the owner?" - I suggest you start getting educated about the filesystem used on your server, for example with the chmod manpage. –  hakre Jun 16 '12 at 7:17
That could be that ftp is the root. I didn't know that ftp could be that. =) If I check my folder with fileZilla the permissions are fine, but the owner is the same as every other file ( owner/ group 102028/33 in my case). Is FileZilla playing games here? =) hakre: thanks for the link! –  Toydor Jun 16 '12 at 7:26
Duplicate of stackoverflow.com/questions/10990/… –  TerryE Jun 16 '12 at 9:55

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.