Unable to open file!
fopen gives above error while opening stream for following code
<?php $myfile = fopen("newfile2.txt", "w") or die("Unable to open file!"); $txt = "John Doe\n"; fwrite($myfile, $txt); $txt = "Jane Doe\n"; fwrite($myfile, $txt); fclose($myfile); ?>
solution was labeling the file using following command.
chcon -t httpd_sys_rw_content_t filename