mkdir() with chmod 777


This should be simple… mkdir(“name”, 0777);

But for some reason it’s not setting full permissions. The group and world values for ‘write’ are not being set. Does anyone know what’s going wrong?

Cheers in advance.


Is the OS windows?

So if it’s windows, the permissions will be set based (likely) on inherited permissions.


No the server’s Linux.

When you say inherited from, presumably you mean frmo the PHP ini file?



Actually, I am not sure, but I don’t think there is a permissions setting for files/folders (for read, write, execute).

I have tried to duplicate your problem on my system, and I get the same results (Apache, and Linux)

You can solve this by issuing a chmod(’./path/to/dir’, 0777) just after the mkdir.