简体   繁体   中英

mkdir() full access and rights

i have a problem with the function mkdir()

i get that error message: Warning: mkdir() [function.mkdir]: Unable to access /user/$id

and do not understand why. i set the rights for this direction to 0777 on my server, means full access to create an direction for everyone. even in my php code is set it up to 0777. but it doesn#t work.

here is my code:

mkdir ( '/user/$id', 0777 );

that means it should create a subfolder into the directionsfolder named user. user is like i already said, 0777. the permission in php too. what am i doing wrong? thanks.

Do you have access to the root folder? You may not have access to add a directory /user.

Try changing the single quotes to double quotes:

mkdir ( "/user/$id", 0777 );

This will allow you to pass the variable value into the string, instead of using $id.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM