Error - php7.2 fpm.sock failed [NGINX - Ubuntu Server]

January 7, 2019 6.4k views
LEMP Ubuntu 18.04 LAMP Stack PHP

I have configured my LEMP server as such, but I have an error. does not charge I get NOT FOUND

You could visit my project to visualize my error

http://178.128.1.213/

LOG ERRORS

root@lemp-s-1vcpu-1gb-sfo2-01:/etc/nginx/sites-available# sudo tail -n 20 /var/log/nginx/error.log
2019/01/07 07:59:44 [crit] 16669#16669: *1 connect() to unix:/var/run/php/php7.2-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 187.225.178.81, server: 178.128.1.213, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.2-fpm.sock:", host: "178.128.1.213"
2019/01/07 07:59:44 [error] 16669#16669: *1 open() "/usr/share/nginx/html/50x.html" failed (2: No such file or directory), client: 187.225.178.81, server: 178.128.1.213, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.2-fpm.sock", host: "178.128.1.213"
2019/01/07 07:59:45 [crit] 16669#16669: *1 connect() to unix:/var/run/php/php7.2-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 187.225.178.81, server: 178.128.1.213, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.2-fpm.sock:", host: "178.128.1.213"
2019/01/07 07:59:45 [error] 16669#16669: *1 open() "/usr/share/nginx/html/50x.html" failed (2: No such file or directory), client: 187.225.178.81, server: 178.128.1.213, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.2-fpm.sock", host: "178.128.1.213"
2019/01/07 07:59:45 [crit] 16669#16669: *1 connect() to unix:/var/run/php/php7.2-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 187.225.178.81, server: 178.128.1.213, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.2-fpm.sock:", host: "178.128.1.213"
2019/01/07 07:59:45 [error] 16669#16669: *1 open() "/usr/share/nginx/html/50x.html" failed (2: No such file or directory), client: 187.225.178.81, server: 178.128.1.213, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.2-fpm.sock", host: "178.128.1.213"
2019/01/07 07:59:45 [crit] 16669#16669: *1 connect() to unix:/var/run/php/php7.2-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 187.225.178.81, server: 178.128.1.213, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.2-fpm.sock:", host: "178.128.1.213"
2019/01/07 07:59:45 [error] 16669#16669: *1 open() "/usr/share/nginx/html/50x.html" failed (2: No such file or directory), client: 187.225.178.81, server: 178.128.1.213, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.2-fpm.sock", host: "178.128.1.213"
2019/01/07 07:59:46 [crit] 16669#16669: *1 connect() to unix:/var/run/php/php7.2-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 187.225.178.81, server: 178.128.1.213, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.2-fpm.sock:", host: "178.128.1.213"
2019/01/07 07:59:46 [error] 16669#16669: *1 open() "/usr/share/nginx/html/50x.html" failed (2: No such file or directory), client: 187.225.178.81, server: 178.128.1.213, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.2-fpm.sock", host: "178.128.1.213"
2019/01/07 08:02:12 [crit] 16820#16820: *1 connect() to unix:/var/run/php/php7.2-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 187.225.178.81, server: 178.128.1.213, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.2-fpm.sock:", host: "178.128.1.213"
2019/01/07 08:02:12 [error] 16820#16820: *1 open() "/usr/share/nginx/html/50x.html" failed (2: No such file or directory), client: 187.225.178.81, server: 178.128.1.213, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.2-fpm.sock", host: "178.128.1.213"
2019/01/07 08:02:12 [crit] 16820#16820: *1 connect() to unix:/var/run/php/php7.2-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 187.225.178.81, server: 178.128.1.213, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.2-fpm.sock:", host: "178.128.1.213"
2019/01/07 08:02:12 [error] 16820#16820: *1 open() "/usr/share/nginx/html/50x.html" failed (2: No such file or directory), client: 187.225.178.81, server: 178.128.1.213, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.2-fpm.sock", host: "178.128.1.213"
2019/01/07 08:02:13 [crit] 16820#16820: *1 connect() to unix:/var/run/php/php7.2-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 187.225.178.81, server: 178.128.1.213, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.2-fpm.sock:", host: "178.128.1.213"
2019/01/07 08:02:13 [error] 16820#16820: *1 open() "/usr/share/nginx/html/50x.html" failed (2: No such file or directory), client: 187.225.178.81, server: 178.128.1.213, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.2-fpm.sock", host: "178.128.1.213"
2019/01/07 09:00:25 [crit] 16820#16820: *6 connect() to unix:/var/run/php/php7.2-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 187.225.178.81, server: 178.128.1.213, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.2-fpm.sock:", host: "178.128.1.213"
2019/01/07 09:00:25 [error] 16820#16820: *6 open() "/usr/share/nginx/html/50x.html" failed (2: No such file or directory), client: 187.225.178.81, server: 178.128.1.213, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.2-fpm.sock", host: "178.128.1.213"
2019/01/07 09:00:42 [crit] 16820#16820: *6 connect() to unix:/var/run/php/php7.2-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 187.225.178.81, server: 178.128.1.213, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.2-fpm.sock:", host: "178.128.1.213"
2019/01/07 09:00:42 [error] 16820#16820: *6 open() "/usr/share/nginx/html/50x.html" failed (2: No such file or directory), client: 187.225.178.81, server: 178.128.1.213, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.2-fpm.sock", host: "178.128.1.213"
root@lemp-s-1vcpu-1gb-sfo2-01:/etc/nginx/sites-available#

this error causes me not to be able to open my project

I tried to do this, but I can not open the file. I get all white

/etc/php/7.2/fpm/pool.d/www.conf

it’s as if the directory did not exist

root@lemp-s-1vcpu-1gb-sfo2-01:/var/www/atenea# cd /etc/php/7.2
root@lemp-s-1vcpu-1gb-sfo2-01:/etc/php/7.2# ls
apache2  cli  fpm  mods-available
root@lemp-s-1vcpu-1gb-sfo2-01:/etc/php/7.2# cd fpm
root@lemp-s-1vcpu-1gb-sfo2-01:/etc/php/7.2/fpm# ls
conf.d
root@lemp-s-1vcpu-1gb-sfo2-01:/etc/php/7.2/fpm# cd conf.d
root@lemp-s-1vcpu-1gb-sfo2-01:/etc/php/7.2/fpm/conf.d# ls
root@lemp-s-1vcpu-1gb-sfo2-01:/etc/php/7.2/fpm/conf.d# ls -la
total 8
drwxr-xr-x 2 root root 4096 Jan  7 07:53 .
root@lemp-s-1vcpu-1gb-sfo2-01:/etc/php/7.2/fpm/conf.d# 
1 comment
  • I have made some modifications like installing php7.2-fpm. but still it keeps showing me error. this is my log

    2019/01/07 09:16:32 [crit] 16820#16820: *24 connect() to unix:/var/run/php/php7.2-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 187.225.178.81, server: 178.128.1.213, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.2-fpm.sock:", host: "178.128.1.213"
    2019/01/07 09:16:32 [error] 16820#16820: *24 open() "/usr/share/nginx/html/50x.html" failed (2: No such file or directory), client: 187.225.178.81, server: 178.128.1.213, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.2-fpm.sock", host: "178.128.1.213"
    2019/01/07 09:18:33 [crit] 16820#16820: *27 connect() to unix:/var/run/php/php7.2-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 187.225.178.81, server: 178.128.1.213, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.2-fpm.sock:", host: "178.128.1.213"
    2019/01/07 09:18:33 [error] 16820#16820: *27 open() "/usr/share/nginx/html/50x.html" failed (2: No such file or directory), client: 187.225.178.81, server: 178.128.1.213, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.2-fpm.sock", host: "178.128.1.213"
    2019/01/07 09:36:19 [crit] 16820#16820: *30 connect() to unix:/var/run/php/php7.2-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 187.225.178.81, server: 178.128.1.213, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.2-fpm.sock:", host: "178.128.1.213"
    2019/01/07 09:36:19 [error] 16820#16820: *30 open() "/usr/share/nginx/html/50x.html" failed (2: No such file or directory), client: 187.225.178.81, server: 178.128.1.213, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.2-fpm.sock", host: "178.128.1.213"
    2019/01/07 09:39:21 [alert] 16820#16820: *39 open socket #11 left in connection 5
    2019/01/07 09:39:21 [alert] 16820#16820: aborting
    2019/01/07 10:01:22 [emerg] 19132#19132: invalid number of arguments in "fastcgi_pass" directive in /etc/nginx/sites-enabled/default:63
    2019/01/07 10:03:29 [emerg] 19143#19143: a duplicate default server for 0.0.0.0:80 in /etc/nginx/sites-enabled/digitalocean:21
    2019/01/07 10:03:39 [emerg] 19159#19159: a duplicate default server for 0.0.0.0:80 in /etc/nginx/sites-enabled/digitalocean:21
    2019/01/07 10:03:57 [emerg] 19183#19183: a duplicate default server for 0.0.0.0:80 in /etc/nginx/sites-enabled/digitalocean:21
    2019/01/07 10:04:11 [emerg] 19210#19210: a duplicate default server for 0.0.0.0:80 in /etc/nginx/sites-enabled/digitalocean:21
    2019/01/07 10:11:14 [notice] 19428#19428: signal process started
    2019/01/07 10:14:03 [notice] 19512#19512: signal process started
    2019/01/07 10:16:39 [emerg] 19570#19570: a duplicate default server for 0.0.0.0:80 in /etc/nginx/sites-enabled/digitalocean:21
    2019/01/07 10:18:18 [alert] 19545#19545: *6 open socket #11 left in connection 4
    2019/01/07 10:18:18 [alert] 19545#19545: aborting
    2019/01/07 10:18:20 [notice] 19640#19640: signal process started
    2019/01/07 10:19:47 [notice] 19737#19737: signal process started
    root@lemp-s-1vcpu-1gb-sfo2-01:~#
    
    
    
    
1 Answer

Hey friend,

Starting with this:

2019/01/07 09:36:19 [error] 16820#16820: *30 open() "/usr/share/nginx/html/50x.html" failed (2: No such file or directory), client: 187.225.178.81, server: 178.128.1.213, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.2-fpm.sock", host: "178.128.1.213"

This suggests to me that php-fpm may not be running. Try “systemctl start php72-fpm” and see if that makes any difference.

This:

2019/01/07 10:01:22 [emerg] 19132#19132: invalid number of arguments in "fastcgi_pass" directive in /etc/nginx/sites-enabled/default:63

Sounds like a syntax error on line 63 of /etc/nginx/sites-enabled/default.

This:

2019/01/07 10:16:39 [emerg] 19570#19570: a duplicate default server for 0.0.0.0:80 in /etc/nginx/sites-enabled/digitalocean:21

Sounds like doubled up configuration in /etc/nginx/sites-enabled/digitalocean, check that you haven’t accidentally doubled the server block.

Jarland

  • thank you friend for your prompt response.

    I have made some changes, at least now I do not get that error. but now it shows me another

    this is my log

    2019/01/07 13:52:30 [error] 19738#19738: *60 directory index of "/var/www/atenea/public/" is forbidden, client: 178.128.101.31, server: 178.128.1.213, request: "POST / HTTP/1.1", host: "178.128.1.213"
    2019/01/07 13:52:30 [error] 19738#19738: *61 directory index of "/var/www/atenea/public/" is forbidden, client: 178.128.101.31, server: 178.128.1.213, request: "POST / HTTP/1.1", host: "178.128.1.213"
    2019/01/07 13:52:31 [error] 19738#19738: *62 directory index of "/var/www/atenea/public/" is forbidden, client: 178.128.101.31, server: 178.128.1.213, request: "POST / HTTP/1.1", host: "178.128.1.213"
    2019/01/07 13:52:34 [error] 19738#19738: *71 directory index of "/var/www/atenea/public/" is forbidden, client: 178.128.101.31, server: 178.128.1.213, request: "GET / HTTP/1.1", host: "178.128.1.213"
    2019/01/07 14:19:09 [error] 19738#19738: *77 directory index of "/var/www/atenea/public/" is forbidden, client: 46.34.172.131, server: 178.128.1.213, request: "GET / HTTP/1.1", host: "178.128.1.213"
    2019/01/07 14:28:58 [error] 19738#19738: *78 directory index of "/var/www/atenea/public/" is forbidden, client: 222.124.182.182, server: 178.128.1.213, request: "GET / HTTP/1.1", host: "178.128.1.213:80"
    2019/01/07 18:28:03 [error] 19738#19738: *79 directory index of "/var/www/atenea/public/" is forbidden, client: 121.200.61.250, server: 178.128.1.213, request: "GET / HTTP/1.1", host: "178.128.1.213:80"
    2019/01/07 19:22:23 [error] 19738#19738: *82 directory index of "/var/www/atenea/public/" is forbidden, client: 103.87.47.116, server: 178.128.1.213, request: "GET / HTTP/1.1", host: "178.128.1.213:80"
    2019/01/07 19:23:50 [error] 19738#19738: *83 directory index of "/var/www/atenea/public/" is forbidden, client: 187.225.178.81, server: 178.128.1.213, request: "GET / HTTP/1.1", host: "178.128.1.213"
    2019/01/07 19:36:26 [error] 19738#19738: *85 directory index of "/var/www/atenea/public/" is forbidden, client: 14.102.46.66, server: 178.128.1.213, request: "GET / HTTP/1.1", host: "178.128.1.213:80"
    2019/01/07 20:03:28 [error] 19738#19738: *86 directory index of "/var/www/atenea/public/" is forbidden, client: 187.225.187.140, server: 178.128.1.213, request: "GET / HTTP/1.1", host: "178.128.1.213"
    2019/01/07 20:07:08 [error] 19738#19738: *89 directory index of "/var/www/atenea/public/" is forbidden, client: 187.225.187.140, server: 178.128.1.213, request: "GET / HTTP/1.1", host: "178.128.1.213"
    2019/01/07 20:07:09 [error] 19738#19738: *89 directory index of "/var/www/atenea/public/" is forbidden, client: 187.225.187.140, server: 178.128.1.213, request: "GET / HTTP/1.1", host: "178.128.1.213"
    2019/01/07 20:07:10 [error] 19738#19738: *89 directory index of "/var/www/atenea/public/" is forbidden, client: 187.225.187.140, server: 178.128.1.213, request: "GET / HTTP/1.1", host: "178.128.1.213"
    2019/01/07 20:07:28 [error] 19738#19738: *91 directory index of "/var/www/atenea/public/" is forbidden, client: 178.128.101.31, server: 178.128.1.213, request: "GET / HTTP/1.1", host: "178.128.1.213"
    2019/01/07 20:07:29 [error] 19738#19738: *93 directory index of "/var/www/atenea/public/" is forbidden, client: 178.128.101.31, server: 178.128.1.213, request: "POST / HTTP/1.1", host: "178.128.1.213"
    2019/01/07 20:07:29 [error] 19738#19738: *94 directory index of "/var/www/atenea/public/" is forbidden, client: 178.128.101.31, server: 178.128.1.213, request: "POST / HTTP/1.1", host: "178.128.1.213"
    2019/01/07 20:07:30 [error] 19738#19738: *95 directory index of "/var/www/atenea/public/" is forbidden, client: 178.128.101.31, server: 178.128.1.213, request: "POST / HTTP/1.1", host: "178.128.1.213"
    2019/01/07 20:07:30 [error] 19738#19738: *96 directory index of "/var/www/atenea/public/" is forbidden, client: 178.128.101.31, server: 178.128.1.213, request: "POST / HTTP/1.1", host: "178.128.1.213"
    2019/01/07 20:07:33 [error] 19738#19738: *105 directory index of "/var/www/atenea/public/" is forbidden, client: 178.128.101.31, server: 178.128.1.213, request: "GET / HTTP/1.1", host: "178.128.1.213"
    
    • That’s a bit better at least. I’m gonna take a gamble here (with no loss if I’m wrong) but it’s a pretty good one. Try running this:

      chown -R www-data. /var/www

      • the error persists

        I even followed this response

        https://stackoverflow.com/questions/19285355/nginx-403-error-directory-index-of-folder-is-forbidden

        but, at the time of entering, I mark an error because it has been redirected too many times, then I modified the code of my web.php routes so that it would not do anything and only show me the welcome page of laravel.

        but I do not work either, knowing that it is not my code’s error because. Previously I tried to upload my project but in LAMP at least everything worked but I exempt the routes. When I wanted to go to another route, I made a mistake, but I returned to LEMP because I had been with Laravel Valet Mac

Have another answer? Share your knowledge.