PHP-FPM user permissions after restart

mac-osxPHPphp-fpm

For some reason after I restart php-fpm daemon, files that were generated using PHP (Twig templating cache) aren't accessible by PHP anymore. I think it's something to do with php-fpm user/group (_www/_www).

Unable to write in the cache directory (/Users/iber/Work/Projects/Work/app/public/assets/compile/3f/87)

The only solution is completely remove the folder contents and reload the page for Twig to compile the files again.

compile directory has 0777 permissions.

php-fpm(v5.5) was installed through homebrew.

What could be the issue here?

Best Answer

So, to answer my own question.

Even though php-fpm.ini had

user = _www
group = _www

It appears that by default installation these lines were commented out:

listen.owner = _www
listen.group = _www

I've uncommented them and it worked.