Answer the question
In order to leave comments, you need to log in
Why does a Permission denied error occur when deleting a PHP file?
First I copy the files to one becup2 folder
$arr = myscandir("./");
$arr2=array();
foreach ($arr as $file) {
if (preg_match('/(.*)\.(.+)/m', $file)){
array_push($arr2,$file);
}
};
foreach ($arr2 as $file) {
$new_file = './becup2/'.$file;
if (copy($file, $new_file)) {
echo 'Файл успешно скопирован!';
}else{
echo 'Файл не удалось скопировать!';
}
chmod($new_file, 0750);
}
Warning: unlink(.htaccess): Permission denied in /home/Stepashka20/public_html/test.php on line 26
Answer the question
In order to leave comments, you need to log in
Check the permissions of the file .htaccess
. Often, his rights are further restricted.
Another possible reason is SELinux
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question