doukanzhuo4297 2019-01-31 05:59
浏览 617

在具有777权限的目录中尝试mkdir()时,我获得了权限被拒绝

When running

$id = mysqli_num_rows($resultSelect) + 1;
    $uploadDir = "/projects/$id/";
    mkdir($uploadDir,0777,true);

I get the errors

Warning: mkdir() [function.mkdir0]: Permission denied in /var/www/devx.online/html/php/newProject.php on line 9

The directory is owned by www-data and the group is www-data. The permissions is 777 for testing, and even still permissions are denied. I am running Ubuntu 18.04 LTS with Apache2.

  • 写回答

2条回答 默认 最新

  • dongsui3297 2019-01-31 06:10
    关注

    => Run this command and You shouldn't need to set the permissions to 777 because it's given to access.

    chown -R www-data:www-data /path/to/webserver/www
    

    Next enabled all members of the www-data group to read and write files

    chmod -R g+rw /path/to/webserver/www
    

    Hoped it work.

    评论

报告相同问题?

问题事件

  • 请采纳用户回复 4月4日

悬赏问题

  • ¥15 jupyterthemes 设置完毕后没有效果
  • ¥15 matlab图像高斯低通滤波
  • ¥15 针对曲面部件的制孔路径规划,大家有什么思路吗
  • ¥15 钢筋实图交点识别,机器视觉代码
  • ¥15 如何在Linux系统中,但是在window系统上idea里面可以正常运行?(相关搜索:jar包)
  • ¥50 400g qsfp 光模块iphy方案
  • ¥15 两块ADC0804用proteus仿真时,出现异常
  • ¥15 关于风控系统,如何去选择
  • ¥15 这款软件是什么?需要能满足我的需求
  • ¥15 SpringSecurityOauth2登陆前后request不一致