title: Why can't my apache process write to my world-writeable file?
body: <p>I'm having this problem and I reached a deadlock, I would try anything I've reached a deadend. My problem goes like this:</p>
  
  <p>I have a Perl/CGI script installed on Fedora 9 machine running apache2, this script have a config file which placed in the same directory, this config file has 777 permissions. </p>
  
  <p>The script can't write to the file. It can read but in no way could I get it to write to it. The file is owned by the same user the apache is running. I wrote a small PHP script to test and placed it in the same folder. The PHP script can read but can't write to it. </p>
  
  <p>I'm so desperate here and I don't know where to start with problem, so any help to get me on the right way would be appreciated.</p>
  
  <p>EDIT: I can open the file for editing from command line; it is apache who can't access it</p>
  
  <p>EDIT2: the folder hierarchy /var/www/cgi-bin/script<br>
         permissions are  like this<br>
  <strong>/var    root   755<br>
  www     root   755<br>
  cgi-bin root   755<br>
  script  apache 755</strong></p>
  
  <p>EDIT: <strong>The problem was in selinux. I disabled it and the script had access to the file thanks for everyone contributed</strong></p>
  
  <p>Thanks in advance</p>