Answer the question
In order to leave comments, you need to log in
Why does nginx logs tell me (13: Permission denied) when executing php scripts?
Hey guys.
Tell me, where are my jambs in setting up nginx + pfp-fpm? In the server logs, I write the following error to a simple script that executes phpinfo ().
2014/09/04 22:06:10 [crit] 3944#0: *455 open() "/var/lib/nginx/tmp/fastcgi/7/04/0000000047" failed (13: Permission denied) while reading upstream, client: xx.xxx.xx.xx, server: xxx.xxx.xxx.xxx, request: "GET /info.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "xxx.xxx.xxx.xxx"
Answer the question
In order to leave comments, you need to log in
Let my_user be the user in whose directory the site is running.
1) In nginx.conf put
2) In php5/fpm/pool.d/www.conf
# Найдите и исправьте на
user = my_user
group = my_user
listen.owner = my_user
listen.group = my_user
Look in /etc/nginx/nginx.conf (maybe a different path in CentOS, I don't know) the line "user nginx;", it should be called that. It should be changed to user www-data; And give rights to the www-data group on your site:
chown -R user:www-data /path/site - where user is your username, /path/site is the path to the site.
See what user nginx is running as and see what permissions are on /var/lib/nginx/tmp/
The user who makes php needs rights to these files. (of course, the directory must also have rights)
php-fpm and nginx should work for you as a single user. And this user must have rights to the above file. You can make a group where to add all these users and give it rights to this file, or rather the entire directory.
The issue was discussed here:
https://www.linux.org.ru/forum/admin/12879857
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question