unlink() 与 scandir() 。 php 错误 Permission denied (document/.) and (document/..)

unlink() with scandir() . php error Permission denied (document/.) and (document/..)

在文件夹“scanner ()”是否筛选,在“unlink ()”和我取消注册后,如果删除文件夹中的文件,但我得到权限被拒绝的错误:

Warning: unlink(path/.): Permission denied in unlink.php on line

Warning: unlink(path/..): Permission denied in unlink.php on line 

我的unlinkphp代码:

$Pscan = scandir("img/movieData/$m_folder/poster/");
     foreach($Pscan as $Pscan_name){
         unlink("img/movieData/$m_folder/poster/$Pscan_name");    
     }

问题已解决:

$Pscan = scandir("img/movieData/$m_folder/poster/");
         foreach($Pscan as $Pscan_name){
             // fixed
             if($Pscan_name == '.' || $Pscan_name == '..'){
                   continue;
             }else{
                   unlink("img/movieData/$m_folder/poster/$Pscan_name");
             }   
         }