php - mkdir permissions mess up -
i have simple code
mkdir('users', 0775);
but when go directory see
drwxr-xr-x 4 www-data www-data 1m jun 11 16:30 users
i expect see
drwxrwxr-x 4 www-data www-data 1m jun 11 16:30 users
what messing permissions?
umask might affecting script. can try temporarily modify via php: http://php.net/manual/en/function.umask.php
$old = umask(0); mkdir('users', 0775); umask($old);
you try change permissions after directory created:
mkdir('users'); chmod('users', 0775);
… recommended on multithreaded web servers.
Comments
Post a Comment