Advertisement
H4T3D

Automatically chmod all directories to (read write execute)

Aug 22nd, 2015
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.37 KB | None | 0 0
  1. <?php
  2. //path to directory to scan
  3. $directory = "/";
  4.  
  5. //get all files in specified directory
  6. $files = glob($directory . "*");
  7.  
  8. //print each file name
  9. foreach($files as $file)
  10. {
  11.  //check to see if the file is a folder/directory
  12.  if(is_dir($file))
  13.  {
  14. // 0777 read write execute for all user + owner
  15.    chmod("$file",0777);
  16.   echo $file."<br></br>";
  17.  }
  18. }
  19.  
  20. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement