PHP 8 - Laravel 9 with Nginx error with FPM unix:/var/run/php/php8.0-fpm.sock failed (2: No such file or directory)

Fer Moreno 16 Reputation points
2022-11-11T15:48:45.537+00:00

I deployed via local git my laravel 9 with PHP8 no errors so far.

Followed instructions to cp default file and set sh script to run at start up (working fine).

When trying to check site I get the 502 Gate way error. The nginx log states:

2022/11/11 14:33:50 [crit] 64#64: *3 connect() to unix:/var/run/php/php8.0-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 169.254.131.1, server: , request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php8.0-fpm.sock:",

I'm using Laravel's server configuration for nginx that points to php8.0-fpm.sock however it is not nowhere to be found. In fact, noticed that despite being run on PHP8 the fpm version of web apps it's actually 7.4

Any suggestions on how to fix it and have the proper fpm version working and at an available location?

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,930 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Fer Moreno 16 Reputation points
    2022-11-11T21:55:06.067+00:00

    Managed to solve it.

    Ngnix config for Laravel in fast cgi must point to:

    fastcgi_pass 127.0.0.1:9000;

    Hope it helps someone else.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.