Page 1 of 1

How do I CHMOD a directory

Posted: Wed Jun 08, 2005 4:36 am
by andylyon87
Hey guys just a quick one really,

How do I go about chmod'ing a directory on my server.

On creation of the folder by ftp_connect() it creates as 0755 and needs to be 0777

Please help

thanks
andy

Posted: Wed Jun 08, 2005 4:40 am
by andylyon87
should I just be able to use,

Code: Select all

chmod($dir, 0777);
Thanks
Andy

Posted: Wed Jun 08, 2005 7:59 am
by phpScott
short answer yes, providing $dir is the correct path to the directory or file.

you may have to look at http://www.php.net/manual/en/function.umask.php if it isn't working right and it's not a path issue.

Posted: Wed Jun 08, 2005 11:21 am
by andylyon87
if

Code: Select all

$dir=/users/$username
because this wont work for me it keeps telling me I dont have the permissions to do that.

is there any way of doing it whilst I have the ft connecton open