PHP无法在目录上分配权限

信息素

我想directory在页面脚本中创建一个

$critere = array();
$critere["bien_code"] = read_post_int("pk");
$name = "parcelle_". $photo->lireBienPhotoSeq().".png";
if ( ! file_exists (RP_PHOTO_PARCELLE) )
    mkdir(RP_PHOTO_PARCELLE, 0777, true);
$dest = RP_PHOTO_PARCELLE . $name;

问题是,在rightsdirectory就是755,当我做一个ls -l在服务器!那么,为什么恐怖分子的权利不是777?

克里希纳

chmod创建目录后尝试使用

所以你的代码应该看起来像这样

$critere = array();
$critere["bien_code"] = read_post_int("pk");
$name = "parcelle_". $photo->lireBienPhotoSeq().".png";
if ( ! file_exists (RP_PHOTO_PARCELLE) )
    mkdir(RP_PHOTO_PARCELLE, 0777, true);
chmod(RP_PHOTO_PARCELLE, 0777); //<------ new line added for giving access
$dest = RP_PHOTO_PARCELLE . $name;

注意:提供对文件夹的0777访问不是一个好主意。它涉及参与看高安全性risk.For风险在这里这里。如果你理解的风险,仍然给0777访问使用它,否则请尽量避免它需要

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章