Why can't PHP create a directory with 777 permissions?

前端 未结 6 1437
小鲜肉
小鲜肉 2020-11-27 12:07

I\'m trying to create a directory on my server using PHP with the command:

mkdir(\"test\", 0777);

But it doesn\'t give full permissions, on

6条回答
  •  盖世英雄少女心
    2020-11-27 12:58

    Avoid using this function in multithreaded webservers. It is better to change the file permissions with chmod() after creating the file.

    Example:

    $dir = "test";
    $permit = 0777;
    
    mkdir($dir);
    chmod($dir, $permit);
    

提交回复
热议问题