View Full Version : mkdir() and file permissions

03-20-2004, 05:16 PM
Hi there,

I'm having some troubles with the mkdir function and the file permissions. I've got the following code in my script:

mkdir($this->_aConfig['path'], 0644);

This is supposed to create a new directory that is readible and writeble for the php-script itself. So I want to be able to create files and sub-derictories inside this newly created directory.

The directory is in fact being made. However the file permissions appear to be 550 (according to WS-FTP). So the script is not allowed to write in the directory ....

Can anyone tell me how I should change the code, for it to work?

Thanx in advance! Michiel

03-22-2004, 02:56 AM
can't see why the mode changes unless its something sneaky your host does ?

regardless try chmodding to something wide open..

create any files or folders you want, then lock it up.

now that is no more likely to work as your original ,butwho knows ?

03-22-2004, 06:12 AM
i've had some problems with the chmod() function. so try:

system("chmod 777 " $this->dirname);