access denied in mkdir function

Whether you are using Linux on the desktop or as a server, it's still good that you're using Linux. Linux related questions go here.

Moderator: General Moderators

Post Reply
agile
Forum Newbie
Posts: 3
Joined: Wed Dec 08, 2010 1:00 pm

access denied in mkdir function

Post 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
User avatar
AbraCadaver
DevNet Master
Posts: 2572
Joined: Mon Feb 24, 2003 10:12 am
Location: The Republic of Texas
Contact:

Re: access denied in mkdir function

Post by AbraCadaver »

I'm pretty sure there is no c:/xampp/htdocs/$dept/$user_name directory on your Linux machine.
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
agile
Forum Newbie
Posts: 3
Joined: Wed Dec 08, 2010 1:00 pm

Re: access denied in mkdir function

Post 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...
User avatar
AbraCadaver
DevNet Master
Posts: 2572
Joined: Mon Feb 24, 2003 10:12 am
Location: The Republic of Texas
Contact:

Re: access denied in mkdir function

Post 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.
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
Post Reply