Nginx. connect () for unix: /tmp/php.socket failed

I am trying to configure nginx on my ubuntu vm and trying to host a php website. I am trying to replicate server setup on my ubuntu vm. I get this error when I try to access a php page from my nginx server. I tried to find the php.socket file inside the / tmp / folder, but there is nothing in it. something is wrong with fastcgi or php on my vm.

The complete error is as follows:

[crit] 9267#0: *1 connect() to unix:/tmp/php.socket failed (2: No such file or directory) while connecting to upstream, client: 192.168.xxx.xxx, server: xxx.xxx.xxx.com, request: "GET /admin/ HTTP/1.1", upstream: "fastcgi://unix:/tmp/php.socket:", host: "xxx.xxx.xxx..com"

please, help. I do not know why this is happening, I am missing a package or something else. I have already installed everything that I assume, and I have the same configurations on the local server.

+4
source share
3 answers

unix TCP\IP Connection:

location ~ .php$ { # fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_pass 127.0.0.1:9000; # ... }

PHP5-FPM ( ), , 7777

+2

i , :

PHP-FastCGI.

, , sudo/etc/init.d/php-fastcgi start

php.socket /tmp, . , , , , , , -:

[] 28830 # 0: * 5 - (110: ) , : 192.168.xxx.xxx, server: xxx.xxx.xxx.com, request: "GET/admin/HTTP/1.1", : "fastcgi://unix:/tmp/php.socket:", host: "xxx.xxx.xxx.com"

, proxy_read_timeout proxy_read_timeout 300; nginx.conf

, , .

+1

php5-fpm , /etc/php5/fpm/pool.d/www.conf .

nginx , :

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

, config nginx "" ( ) .

Sockets must be faster than TCP because there is no overhead. (Perhaps sockets should be configured correctly to provide better performance)

0
source

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


All Articles