[SOLVED] Self-hosted php8.2 "Exception while creating PDO object:could not find driver" after Debian upgrade

Hi, I just upgraded my host from debian 11 to 12 (and thus from php7.4 to php8.2). Since then my tt-rss setup is broken. I have been using the self-hosted tt-rss for about 10 years and update it maybe once or twice a year.

Since the debian update I now get the error “Exception while creating PDO object:could not find driver” thrown, but I’m confident, that the driver is loaded. Other applications using mysql are also working.

$ php -m | grep pdo
pdo_mysql

phpinfo() also confirms the driver is loaded:

PDO
   PDO support           | enabled
   PDO drivers           | mysql
   
pdo_mysql
    PDO Driver for MySQL | enabled
    Client API version   | mysqlnd 8.2.5

I quickly set up a fresh installation following this guide: https://tt-rss.org/wiki/InstallationNotesHost and got the same error.

Is php8.2 unsupported or has anything major changed in the last year?

PS: I’ve been looking around the forum a bit and noticed that many people recommend a Docker installation. Please don’t post me Docker suggestions as I am personally not a big fan of container solutions. I understand the benefits, but I prefer to work on a bare metal system as it puts the security of the libraries and software in the hands of the distribution maintainers and not an individual application developer.

I found the solution and an error in the guide.

The guide says that I have to define “MYSQL” (in uppercase) as database type, but it has to be lower case

putenv('TTRSS_DB_HOST=dbhost');
putenv('TTRSS_DB_NAME=dbname');
putenv('TTRSS_DB_USER=dbuser');
putenv('TTRSS_DB_PASS=dbpassword');
putenv('TTRSS_SELF_URL_PATH=https://example.com/tt-rss');

In case of MySQL/MariaDB, add the following:

putenv('TTRSS_DB_TYPE=MYSQL');           ->  putenv('TTRSS_DB_TYPE=mysql'); 
putenv('TTRSS_DB_PORT=3306');

everything is fine now.

could you link it?

e: nvm, i’ve missed your above post. i’ll make a note to fix that, thanks for noticing.

p.s. don’t use mysql with tt-rss.

I’m running the same setup as the OP, and I’ve never had trouble with tt-rss and MySQL/MariaDB. Can I ask why you’d recommend against doing that?

  • mysql support is only there right now because it’s more work to remove rather than keep it in;
  • i’m not testing anything mysql-related at all;