|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35345 SQLite won't load (specified module not found)
Submitted: 2005-11-23 10:10 UTC Modified: 2008-12-11 16:25 UTC
Avg. Score:4.0 ± 1.2
Reproduced:22 of 22 (100.0%)
Same Version:12 (54.5%)
Same OS:16 (72.7%)
From: csaba at alum dot mit dot edu Assigned: wez (profile)
Status: Not a bug Package: PDO related
PHP Version: 5CVS-2005-11-23 (snap) OS: Win XP Pro
Private report: No CVE-ID: None
 [2005-11-23 10:10 UTC] csaba at alum dot mit dot edu
I downloaded a new snapshot (.zip) of PHP (version 5.1.0 RC7), stopped Apache 2 and overwrote the prior extracted files (about 10), all sitting in c:\winapps\  In addition, I also extracted php_sqlite.dll to the same directory (since my sqlite code which had been relying on PHP 5.1 of Aug 31 no longer functioned).

Next I went into c:\windows\php.ini and added the line
(the only other extension I have loading is php_shmop.dll).

* Note, at the least there seems to be a documentation bug because says to add php_extension=php_sqlite.dll *

Now when I go to restart apache 2, I get the following confirm alert/msgbox twice:
PHP Startup: Unable to load dynamic library './php_sqlite.dll' - The specified module could not be found.

This is an exceptionally unhelpful message as a normal person would suspect that there is a problem locating php_sqlite.dll as that is the only thing specified.  At any rate, the loading is successful if I also add extension=php_pdo.dll to php.ini and plunk php_pdo.dll into the main directory.  Without setting extension nor file for php_pdo_sqlite.dll

Csaba Gabor from Vienna

Expected result:
1.  I expect that all I need to run my older code is php_sqlite.dll
I do not expect to need php_pdo.dll which I do not currently utilitze in my code.  php_pdo.dll should be relying on php_sqlite.dll, if anything, and not the other way around.

2.  I expect the docs in (and perhaps also to mention when I should use only php_sqlite.dll (and set extension), when I need to include php_pdo.dll (and whether I should use php_sqlite.dll with it or php_pdo_sqlite.dll or both).

Actual result:
1.  php_sqlite.dll seems to require php_pdo.dll to function.  This seems counterintuitive, at best.

2.  A user (me) is sure to wonder how the two ...sqlite.dll come into play.  This is in addition/commensurate with being confused about how to swap drivers between v2 and 3 and when one would want to do so.  In other words, there seem to be possibilities of with/without pdo, v2 or v3 drivers, and two distinct sqlite dll's.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-11-23 10:54 UTC]
For reasons discussed on the mailing list recently (see the threads on PHP 5.1 upgrade notes), ext/sqlite depends on the PDO extension, because it provides a sqlite2 PDO driver.

You need to ensure that the PDO extension is loaded before the sqlite extension.
 [2005-11-23 14:56 UTC] smlerman at gmail dot com
I had the same problem. I had extension=php_pdo.dll (plus the drivers for MySQL, Postgres, and SQLite) after the extensions list in php.ini-dist. Moving those lines up above, so that they're before extension=php_sqlite.dll, fixed the problem. Definitely something that needs to be added to the installation docs for SQLite. It also might be a good idea to add the PDO extensions to php.ini-dist. Since the PDO extensions would be before the SQLite extension in alphabetical order anyway, most people would never notice the dependency.
 [2005-12-01 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2006-07-05 04:14 UTC] keyvez at hotmail dot com
I am facing the same problem but in my case it says,
php_sqlite.dll could not be loaded... specified PROCEDURE could not be found.

I have also tried to load php_sqlite.dll after loading all the pdo extensions, i also tried loaded the php_pdo_sqlite.dll and without it too.

Any help is appreciated.

Gaurav Misra
 [2007-02-08 18:45 UTC] sazzad_10 at yahoo dot com
how to solve this problem?

Fatal error: Call to undefined function sqlite_open() in c:\webs\test\testSqlite.php5 on line 13

what i did, In php.ini you must uncomment the line: extension=php_sqlite.dll and above it, add the line: extension=php_pdo.dll Then, restart apache and reload the page

But till now same masses Fatal error: Call to undefined function sqlite_open() in c:\webs\test\testSqlite.php5 on line 13 can you help me plc.
 [2007-05-06 23:43 UTC] kunalspunjabi at yahoo dot com
I am seeing the following error when I add the following lines to my php.ini file:

I then restarted Apache and invoked PHP from the command line:

$ php
PHP Warning:  PHP Startup: Unable to load dynamic library 'C:\Program Files\PHP\ext\php_sqlite.dll' - The specified module could not be found.
 in Unknown on line 0

My PHP extensions directory contains all these DLLs, apparently php_sqlite.dll is the only one that does not load. Why?
 [2007-05-24 09:50 UTC] scriper at mail dot ru
Actually i have the same problem. I've have win xp sp2,php 5.2.2 and apache 2.2.4. In my php.ini i've uncommented:
extension php_pdo.dll
extension php_pdo_mysql.dll
extension php_pdo_sqlite.dll
extension php_pdo_sqlite_external.dll
I checked ext dir, it contains all of that. After restarting apache, and give a request for example http://localhost/index.php i get a Warning:
PHP Startup: Unable to load dynamic library 'C:/php/ext/php_sqlite.dll'- The specified module could not be found.
 [2007-05-24 10:26 UTC] scriper at mail dot ru
Well, after copying php_pdo.dll and php_sqlite.dll to c:/php i have another warning coming: Cannot load module 'SQLite' because required module 'pdo' is not loaded
 [2007-05-24 10:59 UTC] scriper at mail dot ru
Well, when i upgraded from 5.1.6 i've saved my php.ini, now i have replaced it with php.ini.recommended from 5.2.2 dist, uncommented modules and everything goes ok.
 [2008-09-03 08:32 UTC] niz_reez4 at yahoo dot com

//create table
if(file_exists("test.db")) {
	$weNeedToCreateTheDatabase = false;
} else {
	$weNeedToCreateTheDatabase = true;

//create or open database
$db = sqlite_open("test.db") or die("failed to open/create the database");

//create table
if($weNeedToCreateTheDatabase) {
	sqlite_query($db, "CREATE TABLE Members(FirstName,LastName)");

//add info
sqlite_query($db,"INSERT INTO Members VALUES ('Jim', 'Rockerton')");

//get info
$dt = sqlite_query($db, "SELECT * FROM Members");
while ($row = sqlite_fetch_array($dt)) {
echo "row: $row[FirstName] $row[LastName]<br/>";

//close database

 [2008-12-11 15:45 UTC] saravana dot nsk83 at gmail dot com
Hello sir,

i was unable to connect sqlite with php.

Error: Fatal error: Call to undefined function sqlite_open() in C:\webs\test\testsqlite.php5 on line 12

thank you,

 [2008-12-11 16:25 UTC]
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

Please ask support about enabling extensions in the php-install or php-windows mailing list.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 18 22:01:31 2024 UTC