Page 1 of 1

access denied in mkdir function

Posted: Wed Dec 08, 2010 1:11 pm
by agile
hi

i am new linux user. i have a code to make directory like this

<?php
$dept="cse";
$user_name="agile"
mkdir("c:/xampp/htdocs/$dept/$user_name/profile", 0777, true);
chmod("c:/xampp/htdocs/$dept/$user_name/profile", 0777);
?>
it is work in windows. bt in linux it is not working. it gives error like access denied to mkdir

pls. help me regarding this


agile

Re: access denied in mkdir function

Posted: Wed Dec 08, 2010 2:11 pm
by AbraCadaver
I'm pretty sure there is no c:/xampp/htdocs/$dept/$user_name directory on your Linux machine.

Re: access denied in mkdir function

Posted: Wed Dec 08, 2010 2:18 pm
by agile
sry i have tried like this

<?php
$dept="cse";
$user_name="agile"
mkdir("/$dept/$user_name/profile", 0777, true);
chmod("/$dept/$user_name/profile", 0777);
?>

it does not work in linux...

Re: access denied in mkdir function

Posted: Wed Dec 08, 2010 4:01 pm
by AbraCadaver
So the user that your webserver is running as does not have write permissions to the /$dept/$user_name/profile directory. You will have to change the permissions via shell, FTP or your web hosting control panel.