mkdir -p with 777 permissions code example Example: php mkdir with 777 permission $oldmask = umask(0); mkdir("test", 0777); umask($oldmask);