Nginx + Php-fpm Ownership issue !!

shahzaib shahzaib shahzaib.cb at
Wed Dec 30 07:47:33 UTC 2015


We've installed nginx + php-fpm on FreeBSD OS and both of them are
listening on www user / group. Here is the config :


user  www ;


listen = /var/run/www.socket
user = www
group = www
listen.owner = www = www
listen.allowed_clients =


According to these configs, now any files / directory should be created
with www:www permissions in webroot directory by nginx/php-fpm but thats
not happening, new uploaded files via nginx are being uploading with
root:www permissions due to which most of uploading is getting failed. Here
is the permission failed on
(/videos/files/logs/2015/12/30/full-145145901836a71.log) :

2015/12/30 12:03:49 [error] 976#0: *1502344 FastCGI sent in stderr: "PHP
message: PHP Warning:
failed to open stream: Permission denied in /videos/functions.php on line
759" while reading response header from upstream, client:,
server:, request: "POST /actions/file_uploader.php
HTTP/1.1", upstream: "fastcgi://unix:/var/run/www.socket:", host: "", referrer: ""


Now if i check the ownership of newly created
"/videos/files/logs/2015/12/30/" by webserver, it is as follows :

root:www /videos/files/logs/2015/12/30/

It should had been www:www. Where we doing wrong ?

Please help.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list