hello, i would like to ask if there something wrong with this script, the problem is the chmod of the each folder it returns a 755 not a 777: $dirname = 'client/'; mkdir($dirname.$_POST['username'],0777); mkdir($dirname.$_POST['username']."/uploads",0777); mkdir($dirname.$_POST['username']."/documents",0777); mkdir($dirname.$_POST['username']."/archive",0777); PHP: and another thing is when i manually create a folder i mean not using the script... then i change the chmod of each folder into 777. i can't upload the file it say Permission denied. what do you think is the problem? my server is linux, xpanel. is there a problem in configuration of the server? need help thanks...
Some servers are configured to allow a maximum value of 755 when php creates a directory and some limit all directories to a max of 755. The latter sounds like the situation in your case. 755 allows you, the owner and the script to use the file in the normal manner. 777 grants those same rights to the world and can be a security issue.
One alternative may be to chown the client/ directory to apache or nobody (whichever user runs Apache) to allow file writing to the directory. It will mean, though, that you can't get at the files in those directories via FTP.
On servers running under PHPsuexec, Nobody is NOT an option. I quote from an email I received from one of my Hosts below. 755 will be the maximum chmod on this server configuration.
aww... thanks for the reply.. now i know. maybe it's on the server.. now my problem is i can't upload the file via FTP. thankss