Why can't PHP create a directory with 777 permissions?
问题 I\'m trying to create a directory on my server using PHP with the command: mkdir(\"test\", 0777); But it doesn\'t give full permissions, only these: rwxr-xr-x 回答1: The mode is modified by your current umask , which is 022 in this case. The way the umask works is a subtractive one. You take the initial permission given to mkdir and subtract the umask to get the actual permission: 0777 - 0022 ====== 0755 = rwxr-xr-x. If you don't want this to happen, you need to set your umask temporarily to