0
I create a folder with PHP like this
mkdir('/public_html/buscauiva/public_html/'.$_POST['Nome'].'', 0777);
To delete I am using the rmdir() of PHP
dir='/var/www/casamentowagnerecamila.com.br/public_html/buscauiva/public_html/'.$row['nome'].'';
if(rmdir($dir))
{
echo 'Pasta deletada com sucesso.';
}
else
{
echo 'A pasta não pode ser deletada.';
}
But PHP cannot delete the folder by returning the error: Folder cannot be deleted.
How do I delete the folder with php ( contains files inside)?
when creating the folder you don’t need the full path (
/var/www/casamentowagnerecamila.com.br
). You cannot remove this at the time of deleting as well?– rLinhares
yes I did it, but it returns error The folder cannot be deleted
– Wagner Martins Bodyboard
in the
else
, printserror_get_last();
to see what the real mistake is and put in the question, it might help.– rLinhares
did not return any error with error_get_last();
– Wagner Martins Bodyboard