|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #79672 Loading "" fails: undefined symbol: sqlite3_libversion
Submitted: 2020-06-04 10:11 UTC Modified: 2020-12-22 16:54 UTC
From: npelov at croler dot net Assigned:
Status: Wont fix Package: PDO SQLite
PHP Version: 7.3.18 OS: Centos 7.8
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: npelov at croler dot net
New email:
PHP Version: OS:


 [2020-06-04 10:11 UTC] npelov at croler dot net
If pdo_sqlite is compiled as shared with bundled sqlite, the module fails to load with following error:
: symbol lookup error: /usr/local/php73/lib/php/extensions/no-debug-non-zts-20180731/ undefined symbol: sqlite3_libversion

./configure --with-sqlite3=shared --with-pdo-sqlite=shared
make && make install

add to php.ini

php -i|grep sqlite -A 5

phpPDO drivers => sqlite
: symbol lookup error
: /usr/local/php73/lib/php/extensions/no-debug-non-zts-20180731/ pdo_sqlite
undefined symbol: sqlite3_libversion

PDO Driver for SQLite 3.x => enabled

The solution suggested by jd at cpanel in bug 48614 works - patching configure script with this:
       # use bundled libs
+      # This change is anchored here to avoid patch being misapplied.  This really only needs to be added
+      # when pdo_sqlite is compiled shared and using the bundled sqlite3.  It shouldn't hurt so long as the
+      # bundled sqlite3 is used though.
+      shared_objects_pdo_sqlite="$shared_objects_pdo_sqlite ext/sqlite3/libsqlite/sqlite3.lo"
       if test "$enable_maintainer_zts" = "yes"; then

However all of these are workarounds and they are not perfect. I want to use bundled sqlite, because php is tested with it and I don't want to patch configure script every time because updating gets more complicated.

I didn't write in bug 48614 because I assume it's for (unsupported) php 5 and that's why it's not fixed. I'm not sure if php 7 bugs have to be repored separately.

Test script:
// make sure to load extension in php.ini

$memory_db = new PDO("sqlite::memory:");

Expected result:
no error message

Actual result:
php: symbol lookup error: /usr/local/php73/lib/php/extensions/no-debug-non-zts-20180731/ undefined symbol: sqlite3_open_v2


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2020-12-22 16:54 UTC]
-Status: Open +Status: Wont fix
 [2020-12-22 16:54 UTC]
sqlite has been unbundled in PHP 7.4, so this issue is no longer applicable (earlier versions are not actively supported anymore.)
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Feb 25 22:01:26 2024 UTC