We've a workaround documented here that should get you going if you're using Django: Using Databases with Django - SQLite

If you're not using Django, let me know what your setup looks like and I can probably help you get it working.

Not Django, but Calibre-Web.

Anyway, got it figured out. I compiled pysqlite3 from source, renamed the resulting .so (in build/lib.linux-x86_64-3.6/pysqlite3) to _sqlite3.so and put it in the root of the app.

Seems like this should work in most (all?) cases. Perhaps you could have some precompiled binaries available.

10 days later

I built a new version of sqlite3 from source, which works for the commandline and Django:

mkdir ~/src
cd ~/src
wget https://www.sqlite.org/2020/sqlite-autoconf-3330000.tar.gz
tar xzf sqlite-autoconf-3330000.tar.gz
cd sqlite-autoconf-3330000/
./configure --prefix=$HOME
make
make install

Then make sure your ~/bin is at the front of your PATH and set LD_LIBRARY_PATH to your ~/lib. You can edit ~/.bash_profile so that it sets those:

export $HOME/bin:$PATH
export LD_LIBRARY_PATH=$HOME/lib

Then you can source ~/.bash_profile and do sqlite3 --version, which should output the version of your new sqlite3.

    25 days later

    Hi everyone,

    I also need a newer sqlite but for PHP (trying to install Grocy).
    I've tried davidh solution and it seems to work with php in the command line, with php -i I get:

    PDO Driver for SQLite 3.x => enabled
    SQLite Library => 3.33.0

    But when loading a page in the site with:
    print_r(SQLite3::version());
    $dbh = new PDO('sqlite::memory:');
    print_r("SQLite PDO version " . $dbh->query('select sqlite_version()')->fetch()[0]);
    $dbh = null;

    I still get the old version:
    Array ( [versionString] => 3.7.17 [versionNumber] => 3007017 ) SQLite PDO version 3.7.17
    Is there any way to have PHP pick up the local install ?

    Thanks

    • sean replied to this.

      mfg Apache scrubs environment variables before handing the request off to CGI so that's not going to work.

      I'm not sure we have a solution for this at the moment so I'll open an internal ticket for it.

        Thanks for the prompt reply Sean

        2 months later
        a year later
        9 months later

        sean

        Hi! same problem as mfg! (I'd like to install grocy)
        two years have passed, will there be any upgrades?

        thanks in advance

        • sean replied to this.

          osvald0 a newer version is available in /usr/sqlite330:

          $ /usr/sqlite330/bin/sqlite3 --version
          3.30.1 2019-10-10 20:19:45 18db032d058f1436ce3dea84081f4ee5a0f2259ad97301d43c426bc7f3dfalt1

          Hi Sean! thanks for the answer!
          I can't understand how to set it up to use it with apache/nginx, though!
          How can I do it?

          thanks again!

          • sean replied to this.

            osvald0 at this time we don't have a way for you to use the newer SQLite with apps running on our managed PHP setup, but if you run your own PHP-FPM stack then you can add the following to your php-fpm.conf:

            env[LD_LIBRARY_PATH] = /usr/sqlite330/lib

            This will let PHP pick up the newer libraries.

            Mastodon