Bug #79672 [NEW]: Loading "pdo_sqlite.so" fails: undefined symbol: sqlite3_libversion
| From: | npelov at croler dot net | Date: | Thu, 04 Jun 2020 10:11:03 +0000 |
| Subject: | Bug #79672 [NEW]: Loading "pdo_sqlite.so" fails: undefined symbol: sqlite3_libversion | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-227314@lists.php.net to get a copy of this message | ||
From: npelov at croler dot net
Operating system: Centos 7.8
PHP version: 7.3.18
Package: PDO SQLite
Bug Type: Bug
Bug description:Loading "pdo_sqlite.so" fails: undefined symbol: sqlite3_libversion
Description:
------------
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/pdo_sqlite.so:
undefined symbol: sqlite3_libversion
./configure --with-sqlite3=shared --with-pdo-sqlite=shared
make && make install
add to php.ini
extension=sqlite3.so
extension=pdo_sqlite.so
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.so:
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:
else
# 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
threadsafe_flags="-DSQLITE_THREADSAFE=1"
else
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:
---------------
<?php
// make sure to load pdo_sqlite.so 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/pdo_sqlite.so:
undefined symbol: sqlite3_open_v2
--
Edit bug report at https://bugs.php.net/bug.php?id=79672&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=79672&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=79672&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=79672&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=79672&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=79672&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=79672&r=support
Expected behavior: https://bugs.php.net/fix.php?id=79672&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=79672&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=79672&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=79672&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=79672&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=79672&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=79672&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=79672&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=79672&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=79672&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=79672&r=mysqlcfg