Permissions errors in yii2 - vagrant+nginx


I’m currently developing a web app using vagrant + yii2. Been doing ok for a while until today I decided to replace the webserver in my vagrant box for nginx instead of apache.

After some issues configuring the new webserver to access the virtual hosts required by the app and from the advanced template apps I started having some permissions issues which I cannot solve. This is happening from both entry points backend and frontend.

So when I try to access apps frontend I get the following error



which seems to be pretty self explanatory but I couldn’t make it work despite manually chmod to that location and after doing php init and setting the correct environment (which also is doing chmod over assets, uploads, runtime and such).

I tried to delete and recreate folders such as runtime and assets but they keep throwing erros but this time is different 6429


I cannot understand what is going on now. Project was working fine on the vagrant+apache environment but when I changed the webservers and the whole vagrant box was recreated everything started to fail.

Ideas are welcomed! thanks!

Edit: I also tried tweaking the user/group settings in the /etc/php5/fpm/pool.d/www.conf file to vagrant instead of www-data and still showing these errors :(

Did you ever resolve this? I have a Yii2 app that runs okay on my desktop using the built in PHP server, but on an Amazon box with Apache, I get your “can’t mkdir” permission issue, although permissions and ownership on the files seems entirely copacetic.