Php-fpm does not create .sock file

I have an AWS server running on Amazon Linux.

I used this guide to install php7 (at the bottom of the page): https://forums.aws.amazon.com/thread.jspa?messageID=695576

I would like to use nginx instead of Apache, so I also installed the php70w-fpm and nginx packages. However, when I do service start php-fpm, it does not create the php-fpm.sock file anywhere on my server. I logged in to / var / run and also ran find / -name "*.sock"which returns only /var/run/rpcbind.sock.

+9
source share
4 answers

Edit: , www.conf fastcgi_pass nginx . tcp, .

, .sock.

/etc/php-fpm.d/www.conf :

listen = 127.0.0.1:9000

nginx

fastcgi_pass 127.0.0.1:9000;

, -

fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
+3

, , . Python.

python -c "import socket as s; sock = s.socket(s.AF_UNIX); sock.bind('/run/php/php-fpm.sock')"
+1

/etc/php/7.0/fpm/pool.d/wordpress.conf

[wordpress]
listen = /var/run/php7-fpm-wordpress.sock

*.sock , .

+1

php-fpm systemd PrivateTmp php-fpm ( find/etc/systemd -name "php-fpm*" ! -type d : find/etc/systemd -name "php-fpm*" ! -type d)

If this parameter is set to true PrivateTmp=true, PrivateTmp=truea new file system namespace will be created for the main php-process , and another process will not be able to manipulate files in this default namespace (for example, nginx). Read more about the systemd parameter PrivateTmphere: https://www.freedesktop.org/software/systemd/man/systemd.exec.html.

Hope this helps!

0
source

Source: https://habr.com/ru/post/1628542/


All Articles