To change the PHP-FPM process umask to create directories with certain permissions you can set it temporarily using the below.
<?php
$old = umask(0);
mkdir("/path/to/my/dir", 0775);
umask($old);
To change the PHP-FPM process umask to create directories with certain permissions you can set it temporarily using the below.
<?php
$old = umask(0);
mkdir("/path/to/my/dir", 0775);
umask($old);