Score:0

Nginx Error after upgrading php

in flag
Joe

I have an aws server that runs some php code.

I recently upgraded to php8. Now when I access php pages on my site (for example https://whitewaterwriters.com/oracle/index.php) I get a nginx error.

I look at the logs with sudo tail /var/log/nginx/error.log and I get this:

2022/11/22 10:43:23 [crit] 2309#2309: *12122 connect() to unix:/run/php-fpm/www.sock failed (2: No such file or directory) while connecting to upstream, client: 51.148.131.133, server: whitewaterwriters.com, request: "GET /oracle/index.php HTTP/1.1", upstream: "fastcgi://unix:/run/php-fpm/www.sock:", host: "whitewaterwriters.com"

So it's looking for a socket at www.sock. There isn't such a socket (although I do have that socket on a different server that I'd swear I configured the same way) The socket I have is php-frm.sock. That's the socket that the nginx.conf file refers to:

            fastcgi_pass    unix:/var/run/php-fpm/php-fpm.sock;
            fastcgi_index   index.php;
            fastcgi_param   SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            include         fastcgi_params;
                }

and the one that php.ini listens on (at /etc/php-fpm.d/www.conf)

listen = /var/run/php-fpm/php-fpm.sock

My question is: what is the config file that is telling nginx to look for a www.sock? Or how do I create that socket?

Score:0
in flag
Joe

Turns out that the answer to "Where is the config file?" was

/etc/nginx/conf.d/php-fpm.conf - it was pointing to www.conf wheneverthing else wasn't.

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.