Unable to create directory uploads/2015/03. Is its parent directory writable by the server?

My first thought was that this issue was caused by bindfs getting the wrong user/group when setting up nfs-folders. But that led me nowhere.

After a lot of fiddling around I finally got it working again.

I found it a bit odd that group_vars/all defined

web_user: web
web_group: www-data

and that group_vars/development defined

web_user: vagrant

I couldn’t quite figure out what the web user was for. And is still unsure. There seemed indeed to be a disconnect between the right user/group for either nginx or php.

So I searched for all files using www-data and found that roles/php/templates/php-fpm.conf.j2 do.

Changing:

listen.owner = {{ web_user }}
listen.group = {{ web_group }}
user = www-data
group = www-data

To:

listen.owner = {{ web_user }}
listen.group = {{ web_group }}
user = {{ web_user }}
group = {{ web_group }}

And running vagrant provision

This makes PHP run as the vagrant user instead of www-data. I would do a pull-request but I’m not sure this is the correct solution.

Would be great if someone who is well oriented with all the processes and roles could look into this. In the meantime this change worked for me and I hope it works for some of you who are experiencing the same issues.

1 Like