spires Posted October 21, 2009 Share Posted October 21, 2009 Hi I have just created a new directory using php: mkdir('pdffiles/'.$user, 0777, true); however, the permissions are still set to 0755 not 0777? So I have also tried the following: chmod('/var/www/html/businessmobiles.com/comcalc/pdffiles/'.$user', 0777); Which also as no effect. Any ideas why? Thanks Link to comment https://forums.phpfreaks.com/topic/178439-solved-mkdir-help-need/ Share on other sites More sharing options...
spires Posted October 21, 2009 Author Share Posted October 21, 2009 Hi I found a forum post to do with umask. So I gave it a go and it worked. I'm not to sure why it worked but it did. If anyone could explain what happened, that would be great $old_umask = umask(0); mkdir('pdffiles/'.$user, 0777, true); umask($old_mask); Link to comment https://forums.phpfreaks.com/topic/178439-solved-mkdir-help-need/#findComment-940977 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.