Scripting: PHP trouble

started by Nicholas Castorina on Jul 31, 2007 — RSS Feed

Nicholas Castorina Nicholas Castorina
Posts: 1

I'm trying to make a directory with full permission rights using this script:

mkdir($dirpath,0777)


but for some reason it only gives permission 755. Can someone please help me?

J. Cornelius J. Cornelius
Posts: 8

Did you try quoting the directory path?

mkdir("/path/to/directory",0777);

- J

Mike Holloway Mike Holloway
Posts: 0

Try: (note the backticks, not apostrophes!)

`mkdir --mode=777 $dirpath`;

or/

`mkdir -m 777 $dirpath`;

Scott Thompson Scott Thompson
Posts: 9

0777 is the default permission anyway. Make sure the script executing it has the correct permissions in the first place (i would imagine it does). Also, try FTPing to the folders and set the permissions then. If it fails, talk to your web host.

Kind regards,
Scott

If you enjoy programming, then checkout my coder profile http://www.coderprofile.com/coder/VBAssassin

You must login to reply