You are not logged in.

#1 2014-03-25 03:15:47

antuirno
Member
Registered: 2014-03-05
Posts: 10

nginx + php-fpm + mariaDB = not working...

Hi guys,

Can you help me? I'm trying use in my home folder. What I have to do? Look at my files, please:

/etc/nginx/nginx.conf

worker_processes  1;
events {
    worker_connections  1024;
}

http {
    include       mime.types;
    default_type  application/octet-stream;

    server {
        listen 80;
        server_name localhost;
        root   /home/myuser/workspace/php;

        location / {
            autoindex  on;
            index  index.html index.php index.htm;
        }

        location ~ [^/]\.php(/.*)?$ {
            fastcgi_split_path_info ^(.+\.php)(/.*)?$;
            fastcgi_pass   unix:/run/php-fpm/php-fpm.sock;
            fastcgi_index  index.php;
            include fastcgi_params;
            fastcgi_param SCRIPT_FILENAME $document_root$uri;
            fastcgi_param PATH_INFO $fastcgi_path_info if_not_empty;
        }
        location ~ /.ht {
            deny all;
        }
    }
}

/etc/php/php-fpm.conf

[www]
user = http
group = http

;listen = 127.0.0.1:9000
listen = /run/php-fpm/php-fpm.sock

;listen.backlog = 65535

listen.owner = http
listen.group = http
listen.mode = 0660

;listen.allowed_clients = 127.0.0.1

/var/log/nginx/error.log

2014/03/24 23:13:19 [crit] 6752#0: *1 stat() "/home/myuser/workspace/php/index.php" failed (13: Permission denied), client: 127.0.0.1, server: localhost, request: "GET /index.php HTTP/1.1", host: "localhost"

I tested a lot of configuration files and I just receive errors. When I set root like /usr/share/nginx/html or /srv/http/ I can access the index.html. But when I try a index.php, for example, not works.

Last edited by antuirno (2014-03-29 20:55:46)

Offline

#2 2014-03-25 12:07:05

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: nginx + php-fpm + mariaDB = not working...

Have you given the http user read access to the web root?


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#3 2014-03-25 12:23:20

progandy
Member
Registered: 2012-05-17
Posts: 5,280

Re: nginx + php-fpm + mariaDB = not working...

Something like this should work:

setfacl -m u:http:x /home/myuser
setfacl -m u:http:x /home/myuser/workspace
setfacl -m u:http:rwx /home/myuser/workspace/php

and all files in /home/myuser/workspace/ with 644 permissions (r)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#4 2014-03-27 03:36:14

antuirno
Member
Registered: 2014-03-05
Posts: 10

Re: nginx + php-fpm + mariaDB = not working...

Everything works now! Thank you so much progandy!

Offline

#5 2014-03-28 13:58:45

antuirno
Member
Registered: 2014-03-05
Posts: 10

Re: nginx + php-fpm + mariaDB = not working...

The server works great now!

But I have some problems with permissions. I installed a script that require a "write" permission. I don't want type chmod 777 in the folders. What the best way to fix that? Do I have to change groups? Like "chown myuser:http -R folder/" ?

Another question: When I type "chmod XXX(for example, 644) -R folder/" why user, groups and size are replaced with "?" symbol on Arch? How I have to do? When I used Ubuntu that works without any problem.

Thanks for your attention!

Last edited by antuirno (2014-03-28 14:06:48)

Offline

Board footer

Powered by FluxBB