Hi everyone,
I have an issue regarding permissions in my server.
I set permissions to myfile.txt using the cpanel file manager. The permission is set to 600.
Then I run this code in a php script to write to the file:
And then I run this code to read the file:
I expect both write and read to fail but they don’t.
I would expect a permission of ??6 for the php script to work properly.
Am I missing something here? What is wrong?
I have an issue regarding permissions in my server.
I set permissions to myfile.txt using the cpanel file manager. The permission is set to 600.
Then I run this code in a php script to write to the file:
PHP:
$myfile = fopen("myfile.txt", "w") or die("Unable to open file for write!");
$date = date("d/m : H:i:s");
fwrite($myfile, $date);
fclose($myfile);
PHP:
$myfile = fopen("myfile.txt", "r") or die("Unable to open file for read!");
echo nl2br (fread($myfile,filesize("myfile.txt")));
fclose($myfile);
I would expect a permission of ??6 for the php script to work properly.
Am I missing something here? What is wrong?