Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] Nginx php-fpm database internal server error
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
yango
Tux's lil' helper
Tux's lil' helper


Joined: 09 Nov 2020
Posts: 79

PostPosted: Mon Jan 13, 2025 12:20 am    Post subject: [solved] Nginx php-fpm database internal server error Reply with quote

Hello

I was actualizing my server to use php 8.2 alongside php 8.1 as a socket, I have recompiled and made some changes. Now every time that I try to get into a php based webpage I get the message:
Code:
 Internal server error

New and clean php based webpages function Ok, the problem arises with old websites that used to function with that same php version
For now I'm doing tests with Php 2.2.24 and Nginx 1.26.2-r8
Is this because some saved cache?
How can I have more detailed error messages with Nginx? currently I'm using and checking this file:
Code:
error_log /var/log/nginx/localhost.error_log debug;


Last edited by yango on Mon Jan 13, 2025 2:24 pm; edited 2 times in total
Back to top
View user's profile Send private message
yango
Tux's lil' helper
Tux's lil' helper


Joined: 09 Nov 2020
Posts: 79

PostPosted: Mon Jan 13, 2025 1:05 am    Post subject: Reply with quote

I've checked roundcube logs, is something with database connection from MySQL and PostgreSQL:

Code:

 Is the server running on that host and accepting TCP/IP connections? in /roundcube/program/lib/Roundcube/rcube_db.php on line 201 (GET /)
[13-Jan-2025 00:58:18 +0000]: <39qpq5qv> DB Error: SQLSTATE[08006] [7] connection to server at "localhost" (::1), port 5432 failed: Connection refused
        Is the server running on that host and accepting TCP/IP connections?
connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22998

PostPosted: Mon Jan 13, 2025 1:52 am    Post subject: Reply with quote

That message looks like a good hint. Did you check whether the message is correct, that there is no database server running at that location?
Back to top
View user's profile Send private message
Banana
Moderator
Moderator


Joined: 21 May 2004
Posts: 1840
Location: Germany

PostPosted: Mon Jan 13, 2025 9:43 am    Post subject: Reply with quote

The log file depends on the config you use in the nginx config.

Something like this (example)
Code:
server {
         listen       80;
         server_name  example..com;
         root         /var/www/html/;

         access_log /var/log/nginx/example.com-access.log;
         error_log  /var/log/nginx/example.com-error.log error;
         index index.html index.htm index.php;

         location / {
                      try_files $uri $uri/ /index.php$is_args$args;
         }

         location ~ \.php$ {
            fastcgi_split_path_info ^(.+\.php)(/.+)$;
            fastcgi_pass unix:/var/run/php7.2-fpm-site.sock;
            fastcgi_index index.php;
            include fastcgi.conf;
    }
}


And sometimes it makes a difference if you use localhost or 127.0.0.1 in your configs as the server/host address
_________________
Forum Guidelines

PFL - Portage file list - find which package a file or command belongs to.
My delta-labs.org snippets do expire
Back to top
View user's profile Send private message
yango
Tux's lil' helper
Tux's lil' helper


Joined: 09 Nov 2020
Posts: 79

PostPosted: Mon Jan 13, 2025 2:24 pm    Post subject: Reply with quote

Solved, there actualization and change in PHP_TARGETS caused two problems:

    1. Old postgresql version was removed and therefore not initialized, it is solved by installing it in a slot.
    2. Change in PHP_TARGETS caused Nginx rebuild, consequently Nginx groups were deleted and lose permission to access webpage files.


I registered it in here to remember and for other people that could crumble into the same problem. Thank you for your quick replies, I was worried; next time I'll take it with calm.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum