i’m having problem writing to a text file using php. this might sound simple but i’ve set the file owner and group to apache/root, permission to 777 and i’m still unable to write to file. i’m running centos with php 5.3.8.
====================
New info
====================
semanage fcontext -l | grep httpd | grep rw
/var/lib/drupal(/.*)? all files system_u:object_r:httpd_sys_script_rw_t:s0
/var/spool/gosa(/.*)? all files system_u:object_r:httpd_sys_script_rw_t:s0
/var/lib/bugzilla(/.*)? all files system_u:object_r:httpd_bugzilla_script_rw_t:s0
/var/spool/viewvc(/.*)? all files system_u:object_r:httpd_sys_script_rw_t:s0
To allow the directory to be r/w, i used the
chconcommand to add thehttpd_sys_script_rw_ttype to the directory and anything under it:chcon -R -t httpd_sys_script_rw_t <directory>The
-Rflag makes the command recursive.The
-tflag sets the extended attribute on the file to the specified file context. In this case the httpd file contexthttpd_sys_script_rw_twhich is used when: