Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've got nginx 0.7x + PHP-FPM running under PHP 5.2.10 on one RHEL5 server, but trying to duplicate that setup under the bundled-in PHP-FPM in PHP 5.3.3 on a second server, I'm having some trouble with permission errors every time there's a GET.

FPM is started, and confirmed that fastcgi is listening on 9000, but each time I do a GET, I see this error in the nginx log:

2010/08/12 23:38:53 [crit] 5019#0: *5 stat() "/home/noisepages/www/" failed (13: Permission denied), client:, server:, request: "GET / HTTP/1.1", host: ""

Barebones nginx.conf.default works, at least. Here's my nginx.conf

server {
        listen       80;
        root   /home/noisepages/www;
        index  index.html index.htm index.php;

        access_log  logs/dev.access.log;
 error_log logs/dev.error.log;

        location / {

 if (-f $request_filename) {
  expires 30d;

 # this sends all non-existing file or directory requests to index.php
 rewrite ^.*/files/(.*) /wp-includes/ms-files.php?file=$1;
 if (!-e $request_filename) {
     rewrite ^.+?(/wp-.*) $1 last;
  rewrite ^.+?(/.*\.php)$ $1 last;
  rewrite ^ /index.php last;

        location ~ \.php$ {
            include        fastcgi_params;
            fastcgi_pass   unix:/dev/shm/php-fastcgi.sock;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME    /home/dev/www/$fastcgi_script_name;

(The extra rewrite directives are for the use of WordPress multisite aka WordPress MU)

I've also verified that user www-data is declared not only in nginx.conf but also in php-fpm.conf for user and group values.

Maybe I'm not understanding what causes the error 13 message? Oddly enough, I'd tried to set up on the first server in parallel to a couple of other virtual hosts -- each of which was working fine - and got the same error.

share|improve this question
up vote 36 down vote accepted

You need to ensure you have +x on all of the directories in the path leading to the site's root - so /home, /home/noisepages and /home/noisepages/www

share|improve this answer
Yes, in fact www had the correct permissions but not the whole path! Thanks! Makes sense - dumb mistake on my part. – Peter Kirn Aug 13 '10 at 22:53
If I could give you another 10 upvotes I would. – Tim Mar 7 '12 at 23:01
You are really cool! I spend 2 hours in google to find your answer! Thank you! – Serhii Polishchuk Oct 3 '15 at 18:46

I had issues with permissions in php-fpm as well, in particular with php sessions. It turned out I just had to modify the user that php-fpm uses to run processes, since by default it was set to "nobody" user.

tutorial on it here:

share|improve this answer
Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. – Scott Pack Nov 18 '12 at 5:03
The link is dead.. – Christoph Bühler Jun 24 at 8:28

make sure /home/dev has correct permissions

chmod +x /home/dev
share|improve this answer

I had a simlar problem which got me here. My solution (based on the picked answer) was do a

chown -R root:www-data /home/noisepages/www
chmod g+w -R /home/noisepages/www

Now it works fine :)

share|improve this answer
But how can you do it if you use Chroot users ? When using chrooted users, the /home/user/www folder must be owned by the user, and it not works. – Vincent LITUR Feb 7 '14 at 9:41
Sorry, I don't know :( – Scott Warren Feb 7 '14 at 11:29

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.