Q:

mkdir() is not setting chmod to 0777

Why does mkdir not set CHMOD to 0777?
mkdir('/var/www/test', 0777);

After the dir is made the CHMOD is set to 0755
from php.net
bool mkdir ( string $pathname [, int $mode = 0777 [, bool $recursive = false [, resource $context ]]] )

the $mode should be 0777 by default... but if you leave the second argument empty the CHMOD still is set to 0755

A:

From http://php.net/mkdir:

Note: mode is ignored on Windows.
The mode is also modified by the current umask, which you can change using umask().

