0

I'm trying to create a directory but I get the wrong permissions everytime it creates the new directory.

Permissions on the file creating the folder:

rwxr-xr-x

Permission on the folder its trying to create it in

rwxr-xr-x

Both are owned by www-data www-data

I try to create the folder with php

mkdir(location,0775);

Result after running the script

r-----rwt

I ran out of reasons to believe it went wrong.

umask is on 002.

Hope somebody can help me.

Thanks in advance

John
  • 1,095
  • 3
  • 15
  • 31

1 Answers1

0
$location = "path/to/you/dir";
$uold     = umask(0);

mkdir($location,0777,true);
umask($uold);

give that a try and see what it says...

Ian Wood
  • 6,515
  • 5
  • 34
  • 73