Score:0

Error 502, phpinfo() directing to 7.4 when 8.1 is installed (File not found)

hm flag

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?

Score:1
za flag

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.

Wiley Rush avatar
hm flag
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.
drookie avatar
za flag
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.
Wiley Rush avatar
hm flag
I hope you only get egotistical non-answers like yours every time you ask a question in the future.
drookie avatar
za flag
I don't ask questions here, honey, I mostly answer. If you're not mature enough for this - well, **grow up**.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.