0

I'm setting up a web server. I have a freshly installed Ubuntu 22.04, Nginx (welcome page works), and php-fpm which installed php8.1 and php-fpm8.1.

To test PHP, I created a /var/www//info.php which just includes:

<?php phpinfo(); ?> 

Browsing to this page gives Error 502 - Bad Gateway.

Checking /var/log/nginx/error.log shows this:

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

I verified that /var/run/php contains php8.1-fpm.sock but indeed not php7.4-fpm.sock

What is causing the request to look for php7.4? How can I fully configure 8.1 so as not to be reliant on old/multiple versions of php?

1 Answer 1

1

What is causing the request to look for php7.4?

The socket path in your nginx location {} configuration (part that handles php files requests) that you seem to omit completely, but that's the key.

Determine which vhost handles the request, then find the appropriate config file or snippet and fix the socket path to the php-fpm.

4
  • I can't tell if you are trying to provide an answer to the question or scolding me for asking one. I do not know where nginx location is configured. I don't know what vhost is, let alone how to identify its correct config file or snippet. Commented Dec 3, 2022 at 23:37
  • Well, too bad. "To ask a decent question one should already know most part of the answer" (c). Call the nearest on-duty engineer then. Commented Dec 5, 2022 at 10:41
  • I hope you only get egotistical non-answers like yours every time you ask a question in the future. Commented Dec 6, 2022 at 15:23
  • I don't ask questions here, honey, I mostly answer. If you're not mature enough for this - well, grow up. Commented Dec 9, 2022 at 8:39

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.