PHP mkdir: 0777 becomes 0755?

Possible duplicate:
PHP mkdir 0777 fail chmod 0777 works

There is something like this in my PHP code:

$ success = mkdir ($ directory_name, 0777, TRUE);

When I look at the actual folder that he created, the permissions are 0755. Any ideas what could be causing this?

+4
source share
2 answers

Actual permissions are affected by the current umask() value. If it is limited to 755 , then directory permissions. (He xor canceled the requested 777 )

+5
source

Your umask is probably set to 0022 (common by default), not allowing write bits to be set for the group and others. You can use the umask function to change the current umask.

But why, why do you create a directory that can be written in the world? Not a good idea.

+2
source

All Articles