我有问题写入使用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