500 error after new install #1645

Closed
opened 2026-10-05 00:51:23 +02:00 by adam · 4 comments
Owner

I'm using LSIO container and I fill out all the setup stuff and submit, and then just get redirected to upgrade.php in the location bar, but it's Error 500.

The database does get populated with the initial stuff, and the bind mounts get populated with the files; I just get stuck at this point.

Anyone have any ideas?

I'm using LSIO container and I fill out all the setup stuff and submit, and then just get redirected to `upgrade.php` in the location bar, but it's Error 500. The database does get populated with the initial stuff, and the bind mounts get populated with the files; I just get stuck at this point. Anyone have any ideas? <!-- github-sync-id:1641079363 -->
adam closed this issue 2026-10-05 00:51:23 +02:00
Author
Owner

Log in to the server and do sudo tail -100 /var/log/apache2/error.log to find the actual error. In my case (exact same symtoms, also after completely reinstalling latest piwigo and PHP 8.1) the error was:

[Fri Apr 07 13:07:39.736385 2023] [php:error] [pid 13072] [client 192.168.2.156:58072] PHP Fatal error:  Uncaught Error: Call to a member function set_charset() on null in /var/www/html/piwigo/include/dblayer/functions_mysqli.inc.php:88

which seems to indicate the database and user / password combination is not working.

The install guide for piwigo doesn't actually mention this, but you have to add a piwigo database and user if you are setting this up on your own machine.

Log in to the server and do `sudo tail -100 /var/log/apache2/error.log` to find the actual error. In my case (exact same symtoms, also after completely reinstalling latest piwigo and PHP 8.1) the error was: ``` [Fri Apr 07 13:07:39.736385 2023] [php:error] [pid 13072] [client 192.168.2.156:58072] PHP Fatal error: Uncaught Error: Call to a member function set_charset() on null in /var/www/html/piwigo/include/dblayer/functions_mysqli.inc.php:88 ``` which seems to indicate the database and user / password combination is not working. The install guide for piwigo doesn't actually mention this, but you have to add a piwigo database and user if you are setting this up on your own machine. <!-- github-comment-id:1500515371 -->
Author
Owner

@TamaMcGlinn

TY. Turns out I am having some db issues, but it seems to not be a connection issue. I have the connection info set in the config, it connects and it created all the tables, EXCEPT apparently 1 table that it requires. weird.

I get this in my nginx error log:

2023/04/07 21:03:59 [error] 277#277: *3 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught mysqli_sql_exception: Table 'piwigo.piwigo_sites' doesn't exist in /app/www/public/include/dblayer/functions_mysqli.inc.php:132
Stack trace:
#0 /app/www/public/include/dblayer/functions_mysqli.inc.php(132): mysqli->query()
#1 /app/www/public/upgrade.php(224): pwg_query()
#2 {main}
  thrown in /app/www/public/include/dblayer/functions_mysqli.inc.php on line 132" while reading response header from upstream, client: 10.0.40.3, server: _, request: "GET /upgrade.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "piwigo.domain.com"
2023/04/07 21:03:59 [error] 275#275: *5 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught mysqli_sql_exception: Table 'piwigo.piwigo_sites' doesn't exist in /app/www/public/include/dblayer/functions_mysqli.inc.php:132
Stack trace:
#0 /app/www/public/include/dblayer/functions_mysqli.inc.php(132): mysqli->query()
#1 /app/www/public/upgrade.php(224): pwg_query()
#2 {main}
  thrown in /app/www/public/include/dblayer/functions_mysqli.inc.php on line 132" while reading response header from upstream, client: 10.0.40.215, server: _, request: "GET /upgrade.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "piwigo.domain.com"

So for some odd reason it didn't create the piwigo_sites table.

I could manually just create a table in that name but I don't know what columns it requires; any chance you could export that table from your sql and paste it here so I can import it? It would be appreciated! :)

@TamaMcGlinn TY. Turns out I am having some db issues, but it seems to not be a connection issue. I have the connection info set in the config, it connects and it created all the tables, EXCEPT apparently 1 table that it requires. *weird*. I get this in my nginx error log: ``` 2023/04/07 21:03:59 [error] 277#277: *3 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught mysqli_sql_exception: Table 'piwigo.piwigo_sites' doesn't exist in /app/www/public/include/dblayer/functions_mysqli.inc.php:132 Stack trace: #0 /app/www/public/include/dblayer/functions_mysqli.inc.php(132): mysqli->query() #1 /app/www/public/upgrade.php(224): pwg_query() #2 {main} thrown in /app/www/public/include/dblayer/functions_mysqli.inc.php on line 132" while reading response header from upstream, client: 10.0.40.3, server: _, request: "GET /upgrade.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "piwigo.domain.com" 2023/04/07 21:03:59 [error] 275#275: *5 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught mysqli_sql_exception: Table 'piwigo.piwigo_sites' doesn't exist in /app/www/public/include/dblayer/functions_mysqli.inc.php:132 Stack trace: #0 /app/www/public/include/dblayer/functions_mysqli.inc.php(132): mysqli->query() #1 /app/www/public/upgrade.php(224): pwg_query() #2 {main} thrown in /app/www/public/include/dblayer/functions_mysqli.inc.php on line 132" while reading response header from upstream, client: 10.0.40.215, server: _, request: "GET /upgrade.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "piwigo.domain.com" ``` So for some odd reason it didn't create the `piwigo_sites` table. I could manually just create a table in that name but I don't know what columns it requires; any chance you could export that table from your sql and paste it here so I can import it? It would be appreciated! :) <!-- github-comment-id:1500764179 -->
Author
Owner

@TamaMcGlinn

Scratch that request! I managed to find sql to use: https://github.com/Piwigo/Piwigo/blob/master/install/piwigo_structure-mysql.sql

Ran the sql for that table, reloaded and I got in! Thank you for pointing me in the right direction!

@TamaMcGlinn Scratch that request! I managed to find sql to use: https://github.com/Piwigo/Piwigo/blob/master/install/piwigo_structure-mysql.sql Ran the sql for that table, reloaded and I got in! Thank you for pointing me in the right direction! <!-- github-comment-id:1500764994 -->
Author
Owner

You're welcome. I think you can close this issue then.

You're welcome. I think you can close this issue then. <!-- github-comment-id:1502768203 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/Piwigo#1645