ubuntu - apache mkdir php 775 how do I make a folder get created with these permissions?
I figured it out
in the file /etc/apache2/envvars :
add
umask 002
/home/user/.profile umask
/etc/profile
/etc/login.defs
find, set, and uncomment umask 002
check what the current umask is, just run umask, to set it run umask 002
restart Apache :
/etc/init.d/apache2 stop
/etc/init.d/apache2 start
for older ones change it like this
find /home/user -type f -exec chmod 600 {} ;
find all objects of type file (f) in /home/user and run chmod 600 on them.
Or for directories:
find /home/user -type d -exec chmod 700 {} ;
and test it
echo 'makedir';
var_dump(m kdir("test", 0777));
echo 'create file';
$file = fo pen ( "testpermition.php", 'w' );
fw rite ( $file, "test
" );
fclo se ( $file );
Comments