Your code most likely doesn't run as root and a file in /etc
is most likely owned by root. So your PHP script cannot do anything to it.
unlink() doesn't delete the file [closed]
-
31-05-2022 - |
문제
I want to delete some files in a directory.So I used unlink()
.But it doesn't delete the files in perticular directory.Is this a permission problem ?. If so how to solve that .
$path_name="/etc/smokeping/devices/".$menu_name1;
echo $path_name;
// Delete file off of hard disk using PHP command unlink:
$do = unlink($path_name);
if($do == "1")
{
echo "The file was deleted successfully.";
}
else
{
echo "There was an error trying to delete the file.";
}
해결책
제휴하지 않습니다 StackOverflow