mkdir 0777 permissions gets converted to 511 automatically on ubuntu code example
Example: php mkdir recursive
<?php
// Create a directory recursively (make sure to sanitize if taken from input as always!)
mkdir("/path/to/my/dir", 0777, true);
<?php
// Create a directory recursively (make sure to sanitize if taken from input as always!)
mkdir("/path/to/my/dir", 0777, true);