简体   繁体   English

mkdir()的完全访问权限和权限

[英]mkdir() full access and rights

i have a problem with the function mkdir() 我对函数mkdir()有问题

i get that error message: Warning: mkdir() [function.mkdir]: Unable to access /user/$id 我收到该错误消息:警告:mkdir()[function.mkdir]:无法访问/ 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. 我在服务器上将此方向的权限设置为0777,这意味着可以为所有人创建方向。 even in my php code is set it up to 0777. but it doesn#t work. 即使在我的php代码中也将其设置为0777。但是它不起作用。

here is my code: 这是我的代码:

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

that means it should create a subfolder into the directionsfolder named user. 这意味着它应在名为user的Directions文件夹中创建一个子文件夹。 user is like i already said, 0777. the permission in php too. 用户就像我已经说过的,0777。也是php中的权限。 what am i doing wrong? 我究竟做错了什么? thanks. 谢谢。

Do you have access to the root folder? 您有权访问根文件夹吗? You may not have access to add a directory /user. 您可能无权添加目录/ 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. 这将允许您将变量值传递到字符串中,而不是使用$ id。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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