내부의 파일이있는 폴더를 삭제하려고하는데 다음 코드는 파일을 삭제하지만 폴더는 삭제하지 않습니다.PHP가 디렉토리를 삭제할 수 없습니다.
$nameFolder = $_GET['delete'];
$dir = '../projecten/projecten/'.$nameFolder.'';
$filesIN = glob($dir."/"."*");
$status = 'false';
foreach($filesIN as $files) //here i take all the files
unlink($files);
$status = 'true';
if($status=='true'){
rmdir($dir);
$status = 'false';
}
PHP 프로세스가 디렉토리를 삭제할 수있는 소유권/파일 권한이 있습니까? –
[answer] (http://stackoverflow.com/questions/1653771/how-do-i-remove-a-directory-that-is-not-empty)를 참조하십시오. – jerdiggity
- get 매개 변수를 사용하여 임의의 디렉토리를 삭제하는 스크립트에주의하십시오. –