How do I change the NGINX user?

Posted by danielfaraday on Server Fault See other posts from Server Fault or by danielfaraday
Published on 2012-09-29T15:12:02Z Indexed on 2012/09/29 15:39 UTC
Read the original article Hit count: 212

Filed under:
|
|

I have a PHP script that creates a directory and outputs an image to the directory. This was working just fine under Apache but we recently decided to switch to NGINX to make more use of our limited RAM. I'm using the PHP mkdir() command to create the directory:

mkdir(dirname($path['image']['server']), 0755, true);

After the switch to NGINX, I'm getting the following warning:

Warning: mkdir(): Permission denied in ...

I've already checked all the permissions of the parent directories, so I've determined that I probably need to change the NGINX or PHP-FPM 'user' but I'm not sure how to do that (I never had to specify user permissions for APACHE). I can't seem to find much information on this. Any help would be great!

(Note: Besides this little hang-up, the switch to NGINX has been pretty seamless; I'm using it for the first time and it literally only took about 10 minutes to get up and running with NGINX. Now I'm just ironing out the kinks.)

© Server Fault or respective owner

Related posts about php

Related posts about permissions