undefined symbol: sqlite3_libversion

deddy

Well-Known Member
Oct 13, 2003
147
1
168
There seems to be another problem:

[email protected] [~]# php --ri pdo_sqlite

pdo_sqlite

PDO Driver for SQLite 3.x => enabled
php: symbol lookup error: /usr/local/lib/php/extensions/no-debug-non-zts-20090626/pdo_sqlite.so: undefined symbol: sqlite3_libversion
 

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,544
13
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
Twitter
There seems to be another problem:

[email protected] [~]# php --ri pdo_sqlite

pdo_sqlite

PDO Driver for SQLite 3.x => enabled
php: symbol lookup error: /usr/local/lib/php/extensions/no-debug-non-zts-20090626/pdo_sqlite.so: undefined symbol: sqlite3_libversion
At the present time I am unable to reproduce the issue on several systems:
Code:
# /usr/local/bin/php --ri pdo_sqlite

pdo_sqlite

PDO Driver for SQLite 3.x => enabled
PECL Module version => (bundled) 1.0.1 $Id: pdo_sqlite.c 272374 2008-12-31 11:17:49Z sebastian $
SQLite Library => 3.3.7
What is your PHP version (as obtained via the following command)?
Code:
# /usr/local/bin/php -v
What is the output of the following commands (to obtain versions of the OS, cPanel, EasyApache, and the environment type)?
Code:
# grep -H '' /etc/*release /var/cpanel/envtype
# /scripts/easyapache --version
What are the exact steps being used to trigger or reproduce the issue? Please detail the steps as verbosely as possible to ensure the best chance for an accurate reproduction.

If using a custom EasyApache3 build profile please attach it to your reply; EA3 build profiles can be downloaded via WHM using EasyApache. Using the EA3 build profile we can then attempt to compile Apache and PHP in a similar scenario as where the symptom is being experienced.
 

deddy

Well-Known Member
Oct 13, 2003
147
1
168
PHP 5.3.1 (cli) (built: Feb 22 2010 22:06:06)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies
with the ionCube PHP Loader v3.3.10, Copyright (c) 2002-2009, by ionCube Ltd

/etc/redhat-release:CentOS release 5.4 (Final)
/var/cpanel/envtype:standard

Easy::Apache v3.2.0 Build 5009

[cpanel]
11.25.0-RELEASE_43473


[apache]
Server version: Apache/2.2.14 (Unix)
Server built: Feb 22 2010 22:00:37
Cpanel::Easy::Apache v3.2.0 rev5009

No PDO, pdo_sqlite, pdo_mysql can be
found within phpinfo although they were
enabled for compilation.
sqlite3 and sqlite driver is not available.
Only sqlite2 driver.
 

deddy

Well-Known Member
Oct 13, 2003
147
1
168
I checked the problem on another server. Same result:
/usr/local/bin/php --ri pdo_sqlite

pdo_sqlite

PDO Driver for SQLite 3.x => enabled
/usr/local/bin/php: symbol lookup error: /usr/local/lib/php/extensions/no-debug-non-zts-20090626/pdo_sqlite.so: undefined symbol: sqlite3_libversion

php --ri sqlite3

sqlite3

SQLite3 support => enabled
SQLite3 module version => 0.7-dev
SQLite Library => 3.6.19

Directive => Local Value => Master Value
sqlite3.extension_dir => no value => no value
 

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,544
13
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
Twitter
I checked the problem on another server. Same result:
Exactly same probleme here... any help is appreciated.
To deddy and Torsten, if the symptoms persist I would consider escalation via a ticket so that the issue may be properly diagnosed and thoroughly investigated while inspecting the affected system; direct access is necessary so that the surrounding circumstances, including specific configuration and EasyApache3 build profiles, may be inspected in-depth. For reference, the links in my forums signature may be used to initiate a ticket submission (e.g., cPanel Support); when available, please send me a PM me referencing this thread and your new ticket ID number so I may follow-up internally.
 

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,544
13
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
Twitter
To deddy and Torsten, if the symptoms persist I would consider escalation via a ticket so that the issue may be properly diagnosed and thoroughly investigated while inspecting the affected system; direct access is necessary so that the surrounding circumstances, including specific configuration and EasyApache3 build profiles, may be inspected in-depth. For reference, the links in my forums signature may be used to initiate a ticket submission (e.g., cPanel Support); when available, please send me a PM me referencing this thread and your new ticket ID number so I may follow-up internally.
While researching further it appears the issue might be specific to PHP version series 5.3 as per the following PHP bug report: PHP :: Bug #48614 :: Loading "pdo_sqlite.so" fails: undefined symbol: sqlite3_libversion

The only solution I am aware of at the present time is to either disable the PDO SQLite3 extension, by editing the system PHP configuration file "php.ini" (at "/usr/local/lib/php.ini"), or downgrade to PHP 5.2, such as by rebuilding/recompiling using PHP version 5.2.12 that is available in EasyApache.
 

equens

Well-Known Member
Feb 8, 2002
283
5
318
undefined symbol: sqlite3_libversion PHP 5.2.13

I have same problem, downgrade to PHP 5.2.13 does not resolved the problem.
 

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,544
13
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
Twitter
I have same problem, downgrade to PHP 5.2.13 does not resolved the problem.
To the best of my knowledge PHP 5.2 does not use SQLite3, or at least not in a stock-default installation without some level of modification; however, PHP 5.2 does bundle an older version of the SQLite library, that of SQLite2. The bundling of SQLite3 was a new change brought about starting in PHP 5.3.

References:
PHP: PHP 5 ChangeLog
PHP: Migrating from PHP 5.2.x to PHP 5.3.x - New Extensions - Manual

If there is an error regarding SQLite3 while using PHP 5.2 I believe this may indicate a mismatched shared extension that is being loaded, perhaps one that may have been leftover during a downgrade; if you submit a support request we can take a closer look at the unique circumstances involved and assist with investigation. Please let me know the ticket ID number upon submitting the support request so that I may follow-up internally.

To help clarify and compare with earlier information, please let us know the exact error message being seen in PHP 5.2 and what method or command is used to reproduce the issue. If the SQLite extension is used in PHP 5.2, please try removing and then reinstalling the PDO SQLite extension in attempt to ensure the correct version is installed for PHP 5.2.

The following command may be used (via root SSH access) to help locate existing shared extensions for PDO drivers such as SQLite:
Code:
# find /usr/local/lib/php/extensions -iname "pdo*" -o -iname "sqlite*" | sort
Re-installing the SQLite PDO driver may be performed via the following WHM menu path:
WHM: Main >> Software >> Module Installers >> PHP Pecl
 

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,544
13
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
Twitter
To the best of my knowledge PHP 5.2 does not use SQLite3, or at least not in a stock-default installation without some level of modification; however, PHP 5.2 does bundle an older version of the SQLite library, that of SQLite2. The bundling of SQLite3 was a new change brought about starting in PHP 5.3.
I have same problem, downgrade to PHP 5.2.13 does not resolved the problem.
As a correction to my earlier post; I believe I was mistaken in thinking SQLite3 was exclusive to PHP 5.3. Upon testing a fresh build using PHP 5.2.13, I confirmed the SQLite PDO driver is using SQLite Library version 3, exactly as you described.

In attempt to reproduce the difficulty I will perform additional testing, including an upgrade and subsequent downgrade in PHP versions, (from PHP 5.2 to PHP 5.3 and then back to PHP 5.2), while checking for the error after each build; upon completion I will post the results in this thread.
 

equens

Well-Known Member
Feb 8, 2002
283
5
318
Hello cPanelDon,

Code:
# find /usr/local/lib/php/extensions -iname "pdo*" -o -iname "sqlite*" | sort
/usr/local/lib/php/extensions/no-debug-non-zts-20060613/pdo_mysql.so
/usr/local/lib/php/extensions/no-debug-non-zts-20060613/pdo.so
/usr/local/lib/php/extensions/no-debug-non-zts-20060613/pdo_sqlite.so
/usr/local/lib/php/extensions/no-debug-non-zts-20060613/sqlite.so
/usr/local/lib/php/extensions/no-debug-non-zts-20090626/pdo_mysql.so
/usr/local/lib/php/extensions/no-debug-non-zts-20090626/pdo.so
/usr/local/lib/php/extensions/no-debug-non-zts-20090626/pdo_sqlite.so
/usr/local/lib/php/extensions/no-debug-non-zts-20090626/sqlite.so
Request id is: 602910.
 
Last edited:

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,544
13
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
Twitter
Hello cPanelDon,

Code:
# find /usr/local/lib/php/extensions -iname "pdo*" -o -iname "sqlite*" | sort
/usr/local/lib/php/extensions/no-debug-non-zts-20060613/pdo_mysql.so
/usr/local/lib/php/extensions/no-debug-non-zts-20060613/pdo.so
/usr/local/lib/php/extensions/no-debug-non-zts-20060613/pdo_sqlite.so
/usr/local/lib/php/extensions/no-debug-non-zts-20060613/sqlite.so
/usr/local/lib/php/extensions/no-debug-non-zts-20090626/pdo_mysql.so
/usr/local/lib/php/extensions/no-debug-non-zts-20090626/pdo.so
/usr/local/lib/php/extensions/no-debug-non-zts-20090626/pdo_sqlite.so
/usr/local/lib/php/extensions/no-debug-non-zts-20090626/sqlite.so
Request id is: 602910.
Thank you for the additional information and for the support request; I will follow-up internally while this is being investigated further.
 

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,544
13
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
Twitter
As a correction to my earlier post; I believe I was mistaken in thinking SQLite3 was exclusive to PHP 5.3. Upon testing a fresh build using PHP 5.2.13, I confirmed the SQLite PDO driver is using SQLite Library version 3, exactly as you described.

In attempt to reproduce the difficulty I will perform additional testing, including an upgrade and subsequent downgrade in PHP versions, (from PHP 5.2 to PHP 5.3 and then back to PHP 5.2), while checking for the error after each build; upon completion I will post the results in this thread.
For reference purposes, here are the results of my testing; in summary, I was able to reproduce the issue only while PHP 5.3 was installed as after I downgraded back to PHP 5.2 the issue appeared to be alleviated.
  • Existing install using PHP 5.2.13:
    Code:
    # /usr/local/bin/php --ri pdo_sqlite
    
    pdo_sqlite
    
    PDO Driver for SQLite 3.x => enabled
    PECL Module version => (bundled) 1.0.1 $Id: pdo_sqlite.c 293036 2010-01-03 09:23:27Z sebastian $
    SQLite Library => 3.3.7
    
    # /usr/local/bin/php -v
    PHP 5.2.13 (cli) (built: Mar 22 2010 22:06:16) 
    Copyright (c) 1997-2010 The PHP Group
    Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies
        with the ionCube PHP Loader v3.3.10, Copyright (c) 2002-2009, by ionCube Ltd., and
        with Zend Optimizer v3.3.9, Copyright (c) 1998-2009, by Zend Technologies
        with Suhosin v0.9.29, Copyright (c) 2007, by SektionEins GmbH
  • Upgraded install using PHP 5.3.2:
    Code:
    # /usr/local/bin/php --ri pdo_sqlite
    
    pdo_sqlite
    
    PDO Driver for SQLite 3.x => enabled
    /usr/local/bin/php: symbol lookup error: /usr/local/lib/php/extensions/no-debug-non-zts-20090626/pdo_sqlite.so: undefined symbol: sqlite3_libversion
    
    # /usr/local/bin/php -v             
    PHP 5.3.2 (cli) (built: Mar 23 2010 04:34:59) 
    Copyright (c) 1997-2010 The PHP Group
    Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
        with the ionCube PHP Loader v3.3.10, Copyright (c) 2002-2009, by ionCube Ltd.
        with Suhosin v0.9.29, Copyright (c) 2007, by SektionEins GmbH
  • Downgraded install from PHP 5.3.2 to PHP 5.2.13:
    Code:
    # /usr/local/bin/php --ri pdo_sqlite
    
    pdo_sqlite
    
    PDO Driver for SQLite 3.x => enabled
    PECL Module version => (bundled) 1.0.1 $Id: pdo_sqlite.c 293036 2010-01-03 09:23:27Z sebastian $
    SQLite Library => 3.3.7
    
    # /usr/local/bin/php -v
    PHP 5.2.13 (cli) (built: Mar 23 2010 05:49:25) 
    Copyright (c) 1997-2010 The PHP Group
    Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies
        with the ionCube PHP Loader v3.3.10, Copyright (c) 2002-2009, by ionCube Ltd., and
        with Zend Optimizer v3.3.9, Copyright (c) 1998-2009, by Zend Technologies
        with Suhosin v0.9.29, Copyright (c) 2007, by SektionEins GmbH
 

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,544
13
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
Twitter
[...] Request id is: 602910.
Thank you for the additional information and for the support request; I will follow-up internally while this is being investigated further.
After reviewing the noted details from the support request we confirmed the issue was corrected by running EasyApache to rebuild with PHP version 5.2.13.
 

morefood2001

Active Member
Mar 18, 2008
28
0
51
A few months later, I'm having the same exact problem. I just upgraded to PHP 5.3.2 on my server and got the same errors and outputs as above. Is there any time frame for a fix?

In the mean time, I've commented out the offending extension in php.ini manually since I don't think anyone on my server uses this module.
 

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,544
13
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
Twitter
A few months later, I'm having the same exact problem. I just upgraded to PHP 5.3.2 on my server and got the same errors and outputs as above. Is there any time frame for a fix?

In the mean time, I've commented out the offending extension in php.ini manually since I don't think anyone on my server uses this module.
I am not aware of an official fix in PHP at this time; however, any available status updates and progress information may be tracked via the following PHP bug report: PHP :: Bug #48614 :: Loading "pdo_sqlite.so" fails: undefined symbol: sqlite3_libversion
 

Specks

Well-Known Member
Jul 3, 2004
68
0
156
I had this problem on my server and I managed to fix it. I'm using PHP 5.3.2.

This fix requires:

PHP 5.3.2 source
SQLite 3.6.23.1 (http://www.sqlite.org/sqlite-3.6.23.1.tar.gz)

Recompile using easy apache and uncheck PDO and PDO_mysql. Place:

--enable-pdo=shared
--with-pdo-mysql=shared
--with-sqlite3=shared

in the /var/cpanel/easy/apache/rawopts/all_php5 file.

Download and expand the sqlite source.

run configuration and compile it. I used ./configure --prefix=/usr.

Download and expand php 5.3.2 and run the configuration and compile it using the minimal configuration of:

./configure --without-sqlite --with-sqlite3=shared,/usr --enable-pdo=shared --with-pdo-sqlite=shared,/usr

Do not run install after compiling we just want the compiled extensions

Copy the compiled extensions over the old extensions in /usr/local/lib/php/extensions/no-debug-non-zts-20090626.

Restart Apache to make sure the old extensions are out. I'm not sure if it would work with the pdo extension statically compiled in. This is the way I did it. I no longer get the error.
 

Specks

Well-Known Member
Jul 3, 2004
68
0
156
This problem may be moot after the release of the new PHP version.