How to set umask for php5-fpm on Debian?

Viewed 3121

I'm running php5-fpm with nginx connected via port (not socket). It's stock Debian Jessie with all packages installed via apt-get.

I'm trying to change default umask for www-data user that php5-fpm is using from 0022 to 0002 to allow group write permissions. I've tried:

  • editing /etc/init.d/php5-fpm init script and adding --umask 0002 to the start-stop-daemon call, but it was ignored;
  • adding umask 0002 to /var/www/.profile as /var/www is a home directory for www-data user, but it didn't help (I'm not surprised).
  • I'm not using upstart so this solution is not for me.

Also, no matter what I've tried, the command sudo -u www-data bash -c umask always returns 0022.

1 Answers
Related