Issue
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 ?
Solution
- 0755 for directories
- 0644 for files
See chmod
This is assuming that you want everybody to read it.
Answered By - Ed Heal Answer Checked By - David Marino (WPSolving Volunteer)