I\'m trying to open a file for read/write. I\'ve been developing on Ubuntu, and have had no problems whatsoever. Now it\'s time to deploy to the RHEL server, and I discove
To add some specifics to the accepted answer, I also had this exact problem and this command fixed it for me.
chcon -R -t httpd_sys_content_t /path/to/file/it/does/exist/and/has/good/perms