1

I am using unlink() function to delete the folders under assets folder that yii automatically generate. but it gives me the file permission error.
I am using wamp on windows. and also set the folder permission settings in the folder properties and also un-check the read-only option in the properties. but still have the issue.
error is unlink(C:\wamp\www\mysite\assets\8ccb2dcf): Permission denied
my code is

$files = glob('C:\wamp\www\mysite\assets\*');
    foreach($files as $file){
    if(file_exists($file)){
        //here we need to give the permission.
        chmod($file,0755);

    unlink($file); // delete file
    echo 'inside';
    }
Himanshu
  • 4,327
  • 16
  • 31
  • 39
NK143
  • 43
  • 1
  • 9

0 Answers0