-1

my PHP script writes to text.txt files such

 $filename = "pref.enc";  // TEXT FILE
    $file_content = file($filename); 
    $x = count($file_content); 
    $fp = fopen($filename, "w+");  
$file_content[0] = "$my_station" . "\n";
    $y = 0; 
    while($y < $x) 
    { 
    fwrite($fp, $file_content[$y]); 
    $y++; 
    } 
    fclose($fp); 

Which CHMOD permission is recommended for text files AND folder (the folder holds the text files)?

755 or 777 ?

Funk Forty Niner
  • 74,450
  • 15
  • 68
  • 141
Roman
  • 131
  • 2
  • 10

1 Answers1

1
  • 0755 for directories
  • 0644 for files

See chmod

This is assuming that you want everybody to read it.

Ed Heal
  • 59,252
  • 17
  • 87
  • 127