0

I'm running php-fpm, and I'm having a problem that sometimes my code will create a directory as the root user, even though all the php-fpm processes are running as nginx.

The master process itself is running as root, so I suspect that process is the one creating these root-owned directories.

Does anyone have any solutions to this issue?

5
  • can you check that you do not have g+s set on your webroot if it is owned by root group?
    – ek9
    Commented Mar 19, 2014 at 21:58
  • This isn't the log file, is it? Commented Mar 20, 2014 at 1:02
  • No, it's a file in the file system. There's no sticky bit set. Commented Mar 20, 2014 at 2:04
  • 1
    Does "my code" refer to a PHP script that runs via PHP-FPM? Any chance on showing more details on that code? Commented Mar 20, 2014 at 10:14
  • I figured out the issue - another script was running as root elsewhere causing the problem. Commented Mar 20, 2014 at 14:22

1 Answer 1

0

Another script running via cron was running as the root user, which was creating the directories as root. It wasn't related to PHP-FPM at all.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .