title: WordPress unzip_file() results in mkdir_failed (permissions)
body: <p>I am creating a WordPress framework that has an auto update facility. When the system updates the framework, it downloads a .zip file (works ok, stored in a temp folder), and afterwards tries to extract that zip file to a place within the theme. When unzipping, it throws an error complaining about not being able to create a directory ("mkdir_failed").</p>
  
  <p>The parent of target folder has permission "775" for user "bitnami" and group "bitnami";</p>
  
  <blockquote>
    <p>root@linux:/home/bitnami# ls -al /opt/bitnami/apps/wordpress/htdocs/wp-content/themes/nexus
    ...
    drwxrwxr-x 6 bitnami bitnami  4096 Oct 23 14:02 nexusframework
    ...</p>
  </blockquote>
  
  <p>And I tried to put the "daemon" user in the "bitnami" group;</p>
  
  <blockquote>
    <p>usermod -a -G bitnami daemon</p>
  </blockquote>
  
  <p>Which indeed is assigned correctly I would say, as i see:</p>
  
  <blockquote>
    <p>root@linux:/home/bitnami# id daemon
    uid=1(daemon) gid=1(daemon) groups=1(daemon),1000(bitnami)</p>
  </blockquote>
  
  <hr>
  
  <p>So; if the "daemon" user is in the "bitnami" group and the folder has 775 access rights, then why does it fail with "mkdir_failed"?</p>
  
  <p>(note; assigning "777" to the parent folder solves the problem, but this is not an option because of security).</p>
  
  <p>Thanks!
  - Gert-Jan</p>
  
  <hr>
  
  <p>update;</p>
  
  <p>After doing more investigation on Linux in general, I read that Linux automatically creates a 'private' group for each user (so bitnami group for the bitnami user, etc.). I don't know if the problem is caused by the fact that I was trying (and apparently succeeded?) to add other users to the same group or not.</p>
  
  <hr>
  
  <p>update;</p>
  
  <p>See my answer below on how I resolved my issue.</p>