title: Why does Apache + PHP require execution permissions to write to a file?
body: <p>It has always baffled me that if a folder has read and write permissions, Apache + PHP can't write to it. You have to end giving apache execution permissions to be able to write a file in that folder. Why?</p>
  
  <p>For example with chmod 664 (where the build group includes the apache user) apache won't be able to write a temporary cache file in this folder:</p>
  
  <pre><code>drw-rw-r--  5 jenkins build 4096 Jun 15 13:05 cache
  </code></pre>
  
  <p>while with chmod 774 apache will be able to write a new file to the folder: </p>
  
  <pre><code>drwxrwxr--  5 jenkins build 4096 Jun 29 11:44 cache
  </code></pre>