I need to delete files in php and i keep getting this error: N.B : I noticed that all files are deleted except one that causes the error:
Warning: unlink(c:/wamp/www/EmploiPublic/app/Resources/sessions/sess_f0g4jsreposgbv6dkt36sud0v6): Permission denied
$files = glob('c:/wamp/www/EmploiPublic/app/Resources/sessions/*'); // get all file names
foreach($files as $file){ // iterate files
chown($file, 0777);
chmod($file, 0777);
if(is_file($file)){
unlink($file); // delete file
}
}