我有問題寫入使用php的文本文件。這可能聽起來很簡單,但我已經將文件所有者和組設置爲apache/root,對777的權限,我仍然無法寫入文件。我使用php 5.3.8運行centos。php fopen無法打開流:權限被拒絕
====================
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
SELinux的極有可能阻止文件寫入時,如果包含它的目錄不具有RW上下文。 –
你可能需要'chcon -t httpd_sys_rw_content_t/path/to/file' –
我已經將包含該文件的目錄設置爲777並且對根目錄/ apache以及..但仍然不起作用 – nuttynibbles