PHP-FPM not working on sockets but TCP only

I have PHP5-FPM installed on Debian with nginx. When I try to open a PHP page then I get Error 502 Bag Gateway. I found out that it is because I am using sockets which looks like is not properly configured. I have tried to fix it by applying different settings but unable to solve this issue. If I change sockets to 127.0.0.1:9000 then it works fine.

Can you please check following configuration and tell me what am I doing wrong?

pool.d/sf.conf

user = sf
группа = SF
слушайте = /var/run/php5-fpm-sf.sock
listen.owner = SF
listen.group = sf
pm = динамический
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3
chdir = /

В приведенном выше файле я использую /var/run/php5-fpm-sf.sock , потому что /var/run/php5-fpm.sock уже используется используется pool.d / www.conf

php5-fpm-sf.sock разрешение

srw-rw-rw- 1 sf sf 0 10 августа 12:21 / var / run / php5-fpm- sf.sock

сайты-доступные / sf

fastcgi_pass unix: /var/run/php5-fpm-sf.sock

/var/log/nginx/error.log

2017/08/10 12:37:37 [крит] 11666 # 0: * 3 подключить () к unix: /var/run/php5-fpm-sf.sock не удалось (13: в доступе отказано), а подключение к восходящему потоку, клиент: 162.125.12.13, сервер: www.sf.com, запрос: «GET /phptest.php HTTP / 1.1», восходящий поток: "fastcgi: // unix: /var/run/php5-fpm-sf.sock:", host: "sf.com"

1
задан 10 August 2017 в 19:54
1 ответ

Вам просто нужно изменить listen.owner и listen.group на www-data в файле conf пула

user = sf
group = sf
listen = /var/run/php5-fpm-sf.sock
listen.owner = www-data
listen.group = www-data

И не забудьте перезапустить службы fpm и nginx

1
ответ дан 3 December 2019 в 23:27

Теги

Похожие вопросы