php中新文件夹的权限

0 php chmod

我的代码看起来像这样:

do
{
    $rand = rand(1,10000000); 
    $name_of_file_clear = $rand ;
    $name_of_file = $rand . '.JPG' ;
    $name_of_file_t = $rand . '_t.JPG' ; // for thubnsdffafasf
    $this_directory_path = str_replace(basename($_SERVER['PHP_SELF']), '', $_SERVER['PHP_SELF']);
    $images_directory_path = $_SERVER['DOCUMENT_ROOT'] . $this_directory_path . 'img/' . $name_of_file_clear . '/';
    $whole_path = $images_directory_path.$name_of_file;
} while (file_exists($whole_path));

mkdir($images_directory_path, 777);
chmod($images_directory_path, 777);
move_uploaded_file($temp_file_name, $whole_path);
Run Code Online (Sandbox Code Playgroud)

问题是,当我尝试上传文件时,文件不会上传.我认为这个问题与权限有关.请帮帮我,我是php的新手.

Ign*_*ams 5

你用十进制指定它们.尝试在八进制中指定它们.

mkdir($images_directory_path, 0777);
Run Code Online (Sandbox Code Playgroud)