[Nginx+php] connect() to unix:/var/run/php-fpm/php-fpm.sock failed (2: No such file or directory)

2020. 8. 14. 16:00IT/WEB

connect() to unix:/var/run/php-fpm/php-fpm.sock failed (2: No such file or directory)

2020/08/14 10:05:46 [crit] 8538#0: *2 connect() to unix:/var/run/php-fpm/php-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: [my_IP_address], server: [my_domain], request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm/php-fpm.sock:", host: "[my_domain]:82"
2020/08/14 10:05:46 [error] 8538#0: *2 open() "/var/www/html/wordpress/nginx-logo.png" failed (2: No such file or directory), client: [my_IP_address], server: [my_domain], request: "GET /nginx-logo.png HTTP/1.1", host: "[my_domain]:82", referrer: "http://[my_domain]:82/"
2020/08/14 10:05:46 [error] 8541#0: *1 open() "/var/www/html/wordpress/poweredby.png" failed (2: No such file or directory), client: [my_IP_address], server: [my_domain], request: "GET /poweredby.png HTTP/1.1", host: "[my_domain]:82", referrer: "http://[my_domain]:82/"

I had to integrate websites that used Nginx and php into other web servers. This content describes the process of resolving errors that occurred during Web server consolidation.

 

 

First, I checked the versions of Nginx and php.

Before integrating the web server, I matched the same version of Nginx and php. However, when I checked the php version, php was activating the existing version, and I upgraded the version in a new way.

 

How to upgrade PHP version:

The same version of Nginx and php were matched, but the same error occurred. So I reinstalled php-fpm. But the result was same.

// Check package name
# yum list php*fpm

// Remove
# yum remove php70w-fpm -y

// Reinstall
# yum install php70w-fpm -y

 

And I check the path of php-fpm again,

 

NGINX: connect() to unix:/var/run/php7.2-fpm.sock failed (2: No such file or directory)

I've just recently moved my websites from apache2 to Nginx as my new web server backend. got to love problems aha. HTML files in the web host director work prior to php files making there way main

stackoverflow.com

 

Finally, it was resolved through LISTEN value modification and permission setting.

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

[www]
;user = apache
user = nginx
;group = apache
group = nginx

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

;listen.owner = nobody
listen.owner = nginx
;listen.group = nobody
listen.group = nginx
listen.mode = 0660
# systemctl restart nginx php-fpm
 

Permission Denied for fastcgi_pass using PHP7

I'm running LEMP with PHP7.0. I've got this in my server block fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; But when I open the site, it returns a 502 Bad Gateway. Below is the error log. *1

serverfault.com

 

NGINX: connect() to unix:/var/run/php-fpm.sock failed (2: No such file or directory) – The new polyglot

This website uses cookies. If you continue to use this site we will assume that you are happy with this. Accept

www.the-new-polyglot.co.uk