N
N
nepster-web2014-12-26 10:47:04
linux
nepster-web, 2014-12-26 10:47:04

How to fix the rights to the php5-fpm.sock file?

It was necessary to configure the server to work with the project on CentOs.
As I noticed, each hoster has different configurations of the same distribution builds.
I came across a completely bare server, I installed everything I needed on it and ran into a global rights problem. I have not encountered such a problem anywhere, everything has been resolved except for one moment.
The fact is that after each restart of php-fpm, the php5-fpm.sock file is re-created in the tmp folder and resets the rights, that is, nginx does not have access to it and you need to issue rights every time after each restart (I use chmod 777 php5-fpm. sock).
Please tell me how to fix the rights to this file, so that after the restart php-fpm does not reset them?
P.S. before that I set up debian, there was no such problem and this file was in another directory.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
index0h, 2014-12-26
@nepster-web

In the /etc/php5/fpm/pool.d/www.conf file, set the necessary permissions:
listen.owner = www-data
listen.group = www-data
listen.mode = 0660
Then restart fpm
sudo service php5-fpm restart

E
Ergil Osin, 2014-12-28
@Ernillew

Never use 777 on sockets. Never. And then one day some administrator will see this and they will tear off your hands growing from the hip joint.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question