dsa80833 2011-06-20 06:59
浏览 90
已采纳

需要帮助通过PHP在新目录上设置Chmod权限

I am using PHP's mkdir function and I am having some difficulty with the $mode parameters. If I don't specify a parameter, I get UNIX 755 as the default permission settings of the new directory. I would like to set the permission to be UNIX 777, so I did that as you see here:

$mode = '0700';
mkdir($newdir, $mode);

When I do this a folder is created, but I cannot do anything with it. In fact I cannot even delete it! All I can do is rename it via FTP...

I then tried setting $mode = '0600'; This makes a workable folder, but the permissions are set to UNIX 110. How is this possible? Shouldn't it be a UNIX value of 600? Is there some conversion that I am missing out here? Thanks.

  • 写回答

3条回答 默认 最新

  • doukeyong3746487 2011-06-20 07:01
    关注

    The mode is supposed to be a number, not a string. Try $mode = 0700; instead.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 QT6颜色选择对话框显示不完整
  • ¥20 能提供一下思路或者代码吗
  • ¥15 用twincat控制!
  • ¥15 请问一下这个运行结果是怎么来的
  • ¥15 单通道放大电路的工作原理
  • ¥30 YOLO检测微调结果p为1
  • ¥15 DS18B20内部ADC模数转换器
  • ¥15 做个有关计算的小程序
  • ¥15 如何用MATLAB实现以下三个公式(有相互嵌套)
  • ¥30 关于#算法#的问题:运用EViews第九版本进行一系列计量经济学的时间数列数据回归分析预测问题 求各位帮我解答一下