Unexpected error: Module ‘sqlite3’ already loaded in Unknown on line 0

got this error on backlight

reporting as requested…

Something went wrong
Unexpected error: Module ‘sqlite3’ already loaded in Unknown on line 0

See Ben’s reply here about “line 0” errors.

Also, this is your second topic about sqlite errors. Please contact your host, as this seems to be a problem with your service.

This is caused by PHP attempting to load the SQLite module in more than one place. If there is a php.ini file in your home or public_html directory when you access via FTP then try editing it and look for any line like extension=sqlite3. Comment-out the line by preceding it with a semi-colon, like this: ; extension=sqlite3

If you’re managing your own server then look for a similar line under the php settings in /etc/php

If neither option is available to you, then you’ll need to ask your host’s technical support to fix the issue.

Looking at the other SQLite topic you posted, it sounds like you’ve configured your own server.

Check that you have an SQLite config file under /etc/php/conf.d. If you do then I suggest editing /etc/php.ini and commenting out the extension=sqlite3 line there. You’ll need to restart Apache or the PHP server, if running php-fpm.

got it. thanks Ben!

there was an uncommented extension=mysqli . it must have caused a duplicate sql db reference. once commented out all galleries, including hidden ones are accessible.


PK

I am experiencing the same issue (on http://reizen.jacqfish.nl/). I had issues before but could resolve those by using PHP 5.6. Now, for other reasons, I need to go to PHP 7, with 7.x I get above error, with 5.6 it works fine.
As suggested above reported that to my hosts’ support. However, they push me to supplier as they state ‘it is the application doing it wrong’.
I am now caught in the middle… What is a possible way forward?

Is your installation of Backlight up to date?

Hi @Diederick, this is actually an issue on your host’s config. It happens before Backlight starts to run. Errors like this aren’t specific to a particular version of PHP, but instead specific to how your host has configured (or mis-configured) their setup for that version of PHP.

If you have access to PHP settings, perhaps through a php.ini file in your account accessible via FTP, then see if there is a line for the module in the error message and try disabling it by preceding the line with a semi-colon. Otherwise, push your host to fix it.

Thx Ben, indeed the host did change some PHP settings (yet unknown which) which resolved it.
I expected that as well (trusted Backlight :slight_smile:), however, I was here mainly searching for information to help/guide the host to resolve. I do not have access to any installations on the server beyond my own domain content (so no php.ini). From a web interface only PHP version and installed extensions (I am now asking if they did something with the latter).

Hi @Diederick, in my experience this happens when the main PHP config file (php.ini) tries to load a module, followed by module-specific config files again trying to load a module. It should be in one place or the other, not both. This may not be an error that your host has made, but perhaps an issue in how their software installation works. I’ve had it happen to me: run the command to install a PHP module, then find that the installer has created the issue of trying to load the module in both locations.

I’m going to look into whether it’s safe to have Backlight suppress these errors, as it comes up too often in our support forum. Backlight runs on the philosophy that all errors should be reported, to the benefit of our code quality and stability when all errors are dealt with.

Some more background. My host has resolved it by switching off (for my environment) the PHP module sqlite3, with explanation ‘as both modules pdo_sqlite / sqlite3 were selected the problem occurs’. Note: that is their default…
So it works with these settings (default is with also sqlite3 switched on):

Thanks for sharing. It looks like they have a bug in their module handling. Enabling pdo_sqlite enables both modules and that’s not taken into account if sqlite3 is also enabled.