fossar / selfoss

multipurpose rss reader, live stream, mashup, aggregation web application
https://selfoss.aditu.de
GNU General Public License v3.0
2.36k stars 343 forks source link

PDOException #1347

Closed DarkDau closed 2 years ago

DarkDau commented 2 years ago

I do have a long time working selfoss instance @ Buster Now copied to a new Debian Bullseye it won't work anymore. php-sqlite3 is installed

``[2022-07-21 12:25:25] selfoss.DEBUG: Establish database connection
[2022-07-21 12:25:25] selfoss.ERROR: could not find driver {"exception":"[object] (PDOException(code: 0): could not find driver at web/feed/vendor/bcosca/fatfree-core/db/sql.php:519) [stacktrace]

0 web/feed/vendor/bcosca/fatfree-core/db/sql.php(519): PDO->__construct()

1 web/feed/daos/sqlite/Database.php(33): DB\SQL->__construct()

2 web/feed/daos/Database.php(25): daos\sqlite\Database->__construct()

3 web/feed/daos/Tags.php(24): daos\Database->__construct()

4 web/feed/controllers/Index.php(48): daos\Tags->__construct()

5 web/feed/vendor/bcosca/fatfree-core/base.php(1806): controllers\Index->home()

jtojnar commented 2 years ago

Weird. Is that really a fresh Bullseye installation? What PHP version and web server do you use?

If you installed the php-sqlite3 after starting the web server, you might need to still restart the process running PHP:

If you had a different version installed previously, you might need to disable the old PHP module and enable the new one as described in https://stackoverflow.com/a/60747871/160386. Not sure if this would still be necessary today, or with PHP-FPM.

DarkDau commented 2 years ago

Thank you for your hints. I'm using php7.4 and fcgi What I make me confused, the phpinfo gives me for PDO

PDO drivers | mysql

this is weird. Should there something like slite3 ? On old Server:

PDO drivers mysql, pgsql, sqlite

So there is the point I have to fix

jtojnar commented 2 years ago

Yeah, sqlite definitely should be listed among the PDO drivers if you want to use it.

But if I recall correctly, Debian automatically enables the PHP extensions that are installed. And php-pdo-sqlite indeed seems to be what you want.

For fcgi, try restarting the PHP-FPM systemd service guessing sudo systemctl restart php7.4-fpm). Otherwise maybe some Debian support channels like IRC might know more.

DarkDau commented 2 years ago

apt install php7.4-sqlite3 the packet includes the needed pdo lib, while the generic php-sqlite3 does not solved the riddle. thanx a lot!

jtojnar commented 2 years ago

Weird, looking at https://packages.debian.org/bullseye/php-sqlite3, I would expect that one to install php7.4-sqlite3 too.