Using SQLite and PHP 8.1

We added a feature to our site that uses SQLite3, which according to phpinfo() was installed on the server. (I think?)

It turned out that it didn’t work (couldn’t load the class) and Kinsta admins had to re-install SQLite for PHP 8.1 to get it working.

We had the same issue on DevKinsta. We couldn’t load the SQLite3 class on DevKinsta using PHP version 8.1. In order to get it working I had to:

# Enter PHP container as root
docker exec -w /www/kinsta/public/mywebsite -it devkinsta_fpm /bin/bash

# Install SQLite3 for PHP 8.1
apt-get update && apt-get install php8.1-sqlite3

# Restart PHP
/etc/init.d/php8.1-fpm restart

I’m posting this here in case others run into a similar issue, and so I have something to reference when I need to do it again in the future.

Is there any chance the container could be updated to have the package pre-installed for all PHP versions?

Hello there :wave:

You couldn’t completely pre-install this on every PHP version, however, once you install it on one PHP version, and then change to another and install it on another PHP version as well, it should stay installed on both versions when changed in between on that site.

1 Like